Re: Return causes EXC_BAD_ACCESS
Re: Return causes EXC_BAD_ACCESS
- Subject: Re: Return causes EXC_BAD_ACCESS
- From: Kyle Sluder <email@hidden>
- Date: Thu, 28 Jul 2011 15:00:52 -0700
On Thu, Jul 28, 2011 at 2:45 PM, Mr. Gecko <email@hidden> wrote:
> That makes lots of sense, never even expected that to happen. Adding a local variable and setting it to the value before releasing it and returning that variable fixes the issue. I am still looking to an link to explanation in detail as to why this happens. If it's as I said, then I do not think I need it.
There's a very strong but unwritten expectation that self remains
valid for the entirety of a method implementation, except possibly in
-init.
ARC enforces this restriction: self is const in all non-init methods.
I'm not sure what your motivation is for calling [self release] here,
but no code should be doing this.
--Kyle Sluder
_______________________________________________
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