• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Suggestions for debugging “EXC_BAD_ACCESS” [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Suggestions for debugging “EXC_BAD_ACCESS” (From: Bob Barnes <email@hidden>)
 >Re: Suggestions for debugging “EXC_BAD_ACCESS” (From: Greg Parker <email@hidden>)
 >Re: Suggestions for debugging “EXC_BAD_ACCESS” [SOLVED] (From: Bob Barnes <email@hidden>)

  • Prev by Date: Re: Disappearing NSStatusItem
  • Next by Date: Re: Correct way to tell if a path is to a .bundle?
  • Previous by thread: Re: Suggestions for debugging “EXC_BAD_ACCESS” [SOLVED]
  • Next by thread: Global Hotkeys in 64-bit mode
  • Index(es):
    • Date
    • Thread