Closed GoogleCodeExporter closed 8 years ago
This matter was already discussed, and the decision is not to retain the
delegate.
In order to avoid cyclic references, the Apple guidelines specify that when
using the delegate pattern, the delegate object should not be retained.
It is your responsibility to make sure the delegate is not released until the
operation is finished.
The case you have described above can easily be resolved by adding one more
object in the chain.
E.g. In my application I have one class called SOAPConnector, and each SOAP
request is sent in a separate connector instance. I keep all the connectors in
a global array, so the rest of the application can freely retain/release the
connector. Once the response is received (or error), I remove the connector
from the pool. If the other objects of the application have already released
the connector (e.g. they don't need the result anylonger) the connector will
simply get deallocated and the response would be ignored.
Original comment by pmilosev
on 4 Oct 2011 at 11:53
Original issue reported on code.google.com by
daniel.s...@gmail.com
on 24 Jun 2011 at 2:27