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: Corbin Dunn <email@hidden>
- Date: Wed, 19 Jan 2011 15:21:06 -0800
On Jan 19, 2011, at 12:15 PM, Lee Ann Rucker wrote:
> Sounds like a radar bug I filed a while back. It was marked as a duplicate of 6728942
>
>> From my bug:
>
> Snow leopard throws a doesNotRecognizeSelector in NSTableView.
>
> Regression:
> Works on Leopard.
>
> 6 com.apple.ExceptionHandling 0x976b1ebb -[NSExceptionHandler _handleException:mask:] + 331
> 7 com.apple.ExceptionHandling 0x976b1d52 NSExceptionHandlerExceptionRaiser + 228
> 8 libobjc.A.dylib 0x916c2776 objc_exception_throw + 56
> 9 com.apple.CoreFoundation 0x9085072b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
> 10 com.apple.CoreFoundation 0x907b5ae6 ___forwarding___ + 950
> 11 com.apple.CoreFoundation 0x907b56c2 _CF_forwarding_prep_0 + 50
> 12 com.apple.AppKit 0x95548f9d -[NSTableView _dataSourceValueForColumn:row:] + 75
>
> The dataSource and delegate are connected in nibs and never referenced in our code, but we can work around this by setting them to nil explicitly when the window is about to close, so we suspect that it's attempting to use deallocated objects.
In general, it is good practice in your apps to set your delegate and datasource to nil. Who is to say something might cause a draw to happen, which would then message your (now dealloced) delegate? Ideally, NSTableView shouldn't message the delegate/datasource after the window is closed, but something extra "setNeedsDisplay" messages get thrown into it, causing it to happen, and crash. That is why your bug happened. 6728942 made an effort to reduce the display message.
--corbin
_______________________________________________
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