FROM : Fritz Anderson
DATE : Thu Nov 21 20:25:21 2002
Seeing your document's source code would be helpful, but my guess would
be that when the NSTableView tries to redisplay your data, your
NSMutableArray has been released, and the pointer is noo longer valid.
Is it possible you are getting the NSMutableArray by one of the
convenience methods like [NSMutableArray arrayWithObjects:...] or
[NSMutableArray arrayWithCapacity:...]? If so, the resulting pointer is
autoreleased, and will become invalid when the call chain in which it
was created returns. You should either retain that pointer, or obtain a
retained pointer with initializers like [[NSMutableArray alloc]
initWithObjects:...], etc.
-- F
On Thursday, November 21, 2002, at 11:14 AM, Terje Tjervaag wrote:
> I am working through Aron Hillegass' book Cocoa Programming for Mac OS
> X
...
> I have made my own little file class, containing two strings, the
> file name and a description. The application is a document
> application and in my document init method I can create a new file and
> insert it into the NSMutableArray I use as the datasource for the
> tableview. When the application loads it displays this row fine, but
> when I try to call reloadData AFTER that, even though I have not added
> any objects to my array, the application crashes with a "due to signal
> 10 (SIGBUS)".
> Does anyone have ANY clue as to what can be causing this? I would
> give you more details, but I haven't got a clue whats going on here.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Thu Nov 21 20:25:21 2002
Seeing your document's source code would be helpful, but my guess would
be that when the NSTableView tries to redisplay your data, your
NSMutableArray has been released, and the pointer is noo longer valid.
Is it possible you are getting the NSMutableArray by one of the
convenience methods like [NSMutableArray arrayWithObjects:...] or
[NSMutableArray arrayWithCapacity:...]? If so, the resulting pointer is
autoreleased, and will become invalid when the call chain in which it
was created returns. You should either retain that pointer, or obtain a
retained pointer with initializers like [[NSMutableArray alloc]
initWithObjects:...], etc.
-- F
On Thursday, November 21, 2002, at 11:14 AM, Terje Tjervaag wrote:
> I am working through Aron Hillegass' book Cocoa Programming for Mac OS
> X
...
> I have made my own little file class, containing two strings, the
> file name and a description. The application is a document
> application and in my document init method I can create a new file and
> insert it into the NSMutableArray I use as the datasource for the
> tableview. When the application loads it displays this row fine, but
> when I try to call reloadData AFTER that, even though I have not added
> any objects to my array, the application crashes with a "due to signal
> 10 (SIGBUS)".
> Does anyone have ANY clue as to what can be causing this? I would
> give you more details, but I haven't got a clue whats going on here.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.






Cocoa mail archive

