Is it OK to retain a delegate of a subclass of ASIHTTPRequest
?
I made a subclass of ASIHTTPRequest
called JSONRequest
. Each instan
I know that this question is originally about ASIHTTPRequest, but people might stumble upon this thread and it might make them think that using ASIHTTPRequest is still best practice - it is not, infact development has stopped in 2011 AFAIK.
Using more modern HTTP libraries which use blocks by default (I prefer AFNetworking), all variables referenced in fail/success blocks are either copied or retained until the blocks are released. This will spare you this whole memory management headache - except if you use self
in one of the blocks, then you will create a retain cycle until the blocks have been released.