Re: Odd Crash when adding table columns manually
Re: Odd Crash when adding table columns manually
- Subject: Re: Odd Crash when adding table columns manually
- From: Eric Gorr <email@hidden>
- Date: Wed, 19 Jan 2011 20:14:50 -0500
The reason was that removing the table columns from the table prevented the crash from happening.
However, simply setting the the datasource and delegate to nil works as well and is a better solution.
Without any table columns, even though the table might have been marked as dirty, neither the datasource nor delegate was accessed.
The table is also owned by the the scrolling view and therefore the window and would not be deallocated here...it will stick around long after the controller is deallocated.
This is all easily demonstrated by downloading and playing with the sample project.
On Jan 19, 2011, at 7:35 PM, Graham Cox wrote:
>
> On 20/01/2011, at 11:28 AM, Corbin Dunn wrote:
>
>> for ( column in tableColumns )
>> {
>> [table removeTableColumn:column];
>> }
>>
>> [table release];
>
>
> Since the table owns its columns, why not just release the table - if it gets deallocated the columns will go too. As you said this was the clean-up when the window is deallocated, then the table WILL be deallocated here.
>
> Is there some other reason you're going to these unnecessarily complicated lengths?
_______________________________________________
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