• 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: NSTableView crash when selected.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView crash when selected.


  • Subject: Re: NSTableView crash when selected.
  • From: Harry Plate <email@hidden>
  • Date: Tue, 17 Feb 2009 09:51:21 -0800
  • Thread-topic: NSTableView crash when selected.

Shawn, Corbin,

Thanks for the suggestions!

[Corbin]
> 1. break on objc_exception_throw :
> http://www.corbinstreehouse.com/blog/index.php/2008/08/your-most-important-bre
> akpoint-in-cocoa/
> 2. Use Instruments to find the over release:
> http://www.corbinstreehouse.com/blog/index.php/2007/10/instruments-on-leopard-
> how-to-debug-those-random-crashes-in-your-cocoa-app/

Cool stuff. So this helped me find the obj that I should not have released!
My partner had added a [str release] to fix what was thought to be a memory
leak. See below...

[Shawn]
> As a guess you aren't retaining something you need to be retaining so
> the object is disappearing on you.

Yup. Ok. So object retention is a confusing area for me. I am guilty of
making some incorrect assumptions.

Eg, I created an NSString, added it to an NSArray, then created an
NSAttributedString for each array element. So what would the retention count
be? 2 or 3?

During the iteration of the NSArray a [str release] had been added to
address what was thought to be a memory leak; elim that release fixes the
crash.

So when I 'release' an NSArray, can I count on NSArry to release all of its
elements? Likewise for NSTableView? Seems like that would be a valid
assumption. Eg, when we did our leak test we concluded we had to [array
removeAllObject] before we [array release]. This just doesn't seem right...

-harry


_______________________________________________

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

  • Follow-Ups:
    • Re: NSTableView crash when selected.
      • From: Andy Lee <email@hidden>
  • Prev by Date: Re: sticky video/audio files in NSTextView with GC on
  • Next by Date: serialPortSample... hang on "read" function
  • Previous by thread: Re: NSTableView crash when selected.
  • Next by thread: Re: NSTableView crash when selected.
  • Index(es):
    • Date
    • Thread