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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -