NSTableView and crashes, what am I doing wrong?
NSTableView and crashes, what am I doing wrong?
- Subject: NSTableView and crashes, what am I doing wrong?
- From: Henrik Eliasson <email@hidden>
- Date: Tue, 8 Apr 2003 21:50:40 +0200
Dear all,
I'm getting desperate over very strange behavior when trying to
implement an ordinary table uing NSTableView. In Interface Builder, I
have made a window containing an ordinary table view. I have connected
this table view to a controller object as dataSource in which I have
implemented the methods numberOfRowsInTableView: and tableView:
setObjectValue: forTableColumn:. I am using two objects to store the
data to be displayed in the table, a NSMutableArray and a
NSMutableDictionary. I allocate these in the init: method of the
controller object, like so:
- (id)init {
self = [super init];
glassDict = [NSMutableDictionary dictionary];
glassArray = [NSMutableArray array];
return self;
}
Nothing strange with that, I hope. The strange thing happens when the
numberOfRowsInTableView: method gets called, which happens right after
the window in which the table view is located is made visible using the
makeKeyAndOrderFront: message. When the numberOfRowsInTableView: method
gets called, the program crashes with a signal 11 (SIGSEGV). The only
thing this method does is to return the number of elements in the
glassArray according to:
- (int)numberOfRowsInTableView:(NSTableView *)tableView {
return [[self glassArray] count];
}
Could anyone explain what is going on here?
/Henrik
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.