Re: Suggestions for debugging “EXC_BAD_ACCESS” [SOLVED]
Re: Suggestions for debugging “EXC_BAD_ACCESS” [SOLVED]
- Subject: Re: Suggestions for debugging “EXC_BAD_ACCESS” [SOLVED]
- From: Randall Meadows <email@hidden>
- Date: Fri, 25 Sep 2009 17:55:10 -0600
On Sep 25, 2009, at 5:46 PM, Bob Barnes wrote:
Kyle/Nick/Greg,
Thank you guys. Took a little digging but the combination of
NSZombie & instruments object allocation did the job. After years
working with Java I find myself tripping over memory management
issues much too often. I had allocated a UIButton using
buttonWithType: and then later released it without ever having
retained it. I'm concluding (perhaps incorrectly) that using
buttonWithType: doesn't grant 'object ownership' in the same way
that alloc does.
Right. Read the memory management guidelines; they outline the
(simple) rules pretty well. Basically: You own the object if you
receive it via a call that contains "new", "alloc", or "copy", in
which case you *must* -release it. An object received via any other
call, you do *NOT* own, and must *NOT* -release it unless you first -
retain it.
_______________________________________________
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