Skip navigation.
 
mlRe: NSCell copyWithZone producing EXC_BAD_ACCESS
FROM : Ricky Sharp
DATE : Sun Nov 11 22:51:04 2007

On Nov 11, 2007, at 3:21 PM, Graham wrote:

> My application worked without problems in Tiger but crashes in 
> Leopard as follows...
>
> I am using an NSBrowser for which I am supplying a custom cell class 
> called SelectionCell (inherits from NSBrowserCell).
> I set the prototype in the browser's matrix as follows:
>
> [matrix setPrototype:[SelectionCell alloc]];


You're not calling an init method here.

> and this is where I get the crash, with the following stack trace:
>
> #0    0x9006c9a7 in -[NSCell copyWithZone:]
> #1    0x9025da12 in -[NSMatrix setPrototype:]
> #2    0x00008074 in -[BrowserDelegate 
> browser:createRowsForColumn:inMatrix:] at BrowserDelegate.m:262
> #3    0x903fc24c in -[NSBrowser 
> _sendDelegateCreateRowsForColumn:inMatrix:]
> #4    0x902724b7 in -[NSBrowser addColumn]
> #5    0x90271725 in -[NSBrowser loadColumnZero]
> #6    0x000056a0 in -[Controller startup] at Controller.m:417
> #7    0x000041f9 in -[Controller getToken] at Controller.m:236
> #8    0x000046ed in -[Controller carryOn:] at Controller.m:280
> #9    0x90114f94 in -[NSApplication sendAction:to:from:]
> #10    0x90114ed4 in -[NSControl sendAction:to:]
> #11    0x90114d5a in -[NSCell _sendActionFrom:]
> #12    0x901143bb in -[NSCell trackMouse:inRect:ofView:untilMouseUp:]
> #13    0x90113c12 in -[NSButtonCell 
> trackMouse:inRect:ofView:untilMouseUp:]
> #14    0x901134cc in -[NSControl mouseDown:]
> #15    0x90111d9b in -[NSWindow sendEvent:]
> #16    0x900dea2c in -[NSApplication sendEvent:]
> #17    0x9003c705 in -[NSApplication run]
> #18    0x900099ba in NSApplicationMain
> #19    0x00002638 in main at main.m:6



BTW, I'm quite surprised this didn't cause an issue under Tiger.

___________________________________________________________
Ricky A. Sharp        mailto:<email_removed>
Instant Interactive(tm)  http://www.instantinteractive.com

Related mailsAuthorDate
mlNSCell copyWithZone producing EXC_BAD_ACCESS Graham Nov 11, 22:21
mlRe: NSCell copyWithZone producing EXC_BAD_ACCESS Ricky Sharp Nov 11, 22:51
mlRe: NSCell copyWithZone producing EXC_BAD_ACCESS Graham Nov 12, 14:57