Re: Does autoreleased NSURLConnection object guarantee job completion?
Re: Does autoreleased NSURLConnection object guarantee job completion?
- Subject: Re: Does autoreleased NSURLConnection object guarantee job completion?
- From: Michael Ash <email@hidden>
- Date: Fri, 13 Aug 2010 13:38:59 -0400
On Thu, Aug 12, 2010 at 10:51 PM, yanghb <email@hidden> wrote:
> if the instance is released in delegate, what to perform the following
> code?OK, maybe code segment will always be there, but if the code
> access some instance vairable, it just will cause EXEC_ACCESS_BAD,
> isn't it?
This is absolutely correct. If you're going to release an object from
inside a delegate callback made by that object (which is *usually*
something you should avoid anyway), then use autorelease, rather than
release, to ensure that the object has a chance to finish its own code
before being destroyed.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden