objective c - Releasing memory of a class which is calling a async method -
i have code this,
classa *reference = [[classa alloc] init]; reference.delegate = self; [reference callasynchmethod];
here calling asynchronous method. takes around 4-5 seconds execute. how release memory of classa? if call release or autorelease crashes.
thank you
perhaps can make object retain @ start of callasynchmethod
, , release after calls (i presume) delegate method signals end of asynchronous work? then, in code above, release immediately.
edit
if you're talking nsurlconnection
, should use instance variable reference connection, , pass release
in dealloc
implementation of object.
Comments
Post a Comment