• 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: premature dealloc of the datasource of a NSTableView crashes my application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: premature dealloc of the datasource of a NSTableView crashes my application


  • Subject: Re: premature dealloc of the datasource of a NSTableView crashes my application
  • From: Brian Stern <email@hidden>
  • Date: Sun, 5 Oct 2008 13:31:44 -0400


On Oct 4, 2008, at 11:36 PM, Michael Ash wrote:

Absolutely not. Write your code to work with any order. In this case, what you should do is write your data source to nil out the table's reference to it when it goes away:

- (void)dealloc {
   [tableView setDataSource:nil];
   [super dealloc];
}

What prevents the tableview from being dealloced before the datasource? In that case the datasource is messaging a stale pointer.


I think that something higher up in the ownership graph needs to manage this, like the window controller.


-- Brian Stern email@hidden



_______________________________________________

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: premature dealloc of the datasource of a NSTableView crashes my application
      • From: "Michael Ash" <email@hidden>
References: 
 >premature dealloc of the datasource of a NSTableView crashes my application (From: "Dr. Rolf Jansen" <email@hidden>)
 >Re: premature dealloc of the datasource of a NSTableView crashes my application (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Create CGImageRef with transparency
  • Next by Date: Re: Create CGImageRef with transparency
  • Previous by thread: Re: premature dealloc of the datasource of a NSTableView crashes my application
  • Next by thread: Re: premature dealloc of the datasource of a NSTableView crashes my application
  • Index(es):
    • Date
    • Thread