Re: Mysterious crash with NSTableView
Re: Mysterious crash with NSTableView
- Subject: Re: Mysterious crash with NSTableView
- From: Alex Zavatone <email@hidden>
- Date: Sat, 27 Aug 2016 11:10:54 -0500
Sent from my iPad. Please pardon typos.
On Aug 26, 2016, at 10:42 AM, Andreas Falkenhahn <email@hidden> wrote:
> On 26.08.2016 at 17:35 Gary L. Wade wrote:
>
>> Try clearing your table view's data source and delegate before
>> releasing their object. It appears the pointer gets reassigned to an
>> NSRectSet before your table view completely goes away but after its delegate and data source have.
>
> Great, that solves it. Thanks a lot!
>
> But once again, I think it's a crime that there is no mentioning of this in the class
> documentation of "setDelegate" and "setDatasource" :(
>
Agrees as it SHOULD be understood by the programmer as "well, that is simply how part of Objective-C works so I should EXPECT to have to set them."
Buuut, to the mind of the person learning this or trying to fit all the complexity of learning this in their head, it might be wise in the docs to remind the programmer that they need to do this and why with a, "just in case you are assuming that your code is ready to function now, please remember that the objects that end up making a working tableView require that the tableView's dataSource object and delegate object need to be assigned, generally to the hosting view controller's instance of self. If this causes you to raise an eyebrow in confusion, the reasons why you must do this are xxx and yyyy. Likewise upon deallocation of the tableView (if it gets called), these objects will need to be set to nil after zzzz but before the tableView object is able to dispose of itself."
Please feel free to use this as a running start on an addition to the docs that actually explains to the programmer how they will most likely set up their tableView.
- Alex Zavatone
> --
> Best regards,
> Andreas Falkenhahn mailto: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
_______________________________________________
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