[NEWBIE]: Active loading of browser
[NEWBIE]: Active loading of browser
- Subject: [NEWBIE]: Active loading of browser
- From: J Tichenor <email@hidden>
- Date: Fri, 22 Oct 2004 09:36:21 +0100
I am trying to implement the active loading of my NSBrowser. As per docs, I am using delegation and implementing the following:
- (void)browser:(NSBrowser *)sender createRowsForColumn:(int)column inMatrix:(NSMatrix *)matrix {
NSEnumerator *enum1;
NSBrowserCell *aCell = [[NSBrowserCell alloc] init];
NSMutableArray *anArray = [NSMutableArray array];
int index = 0;
if ( column == 0 ) { // set no matter what -- will implement other column checks once I get the first one working
enum1 = [[trackerApp projects] objectEnumerator];
Project *proj;
while (proj = [enum1 nextObject]) {
[aCell setTitle:[[proj projectVitals] projectTitle]];
[aCell setRepresentedObject:proj];
if ([proj countOfEpisodes] > 0)
[aCell setLeaf: NO];
else [aCell setLeaf: YES];
[anArray addObject:aCell];
}
[matrix addRowWithCells:anArray];
}
}
As far as I can tell from scant documentation, this should work. But instead I get this error:
*** Assertion failure in -[NSMatrix insertRow:withCells:], AppKit.subproj/NSMatrix.m:1213
2004-10-21 18:38:26.549 VFX Tracker[2249] An uncaught exception was raised
2004-10-21 18:38:26.549 VFX Tracker[2249] Invalid parameter not satisfying: !newCells || ([newCells count] == _numCols)
2004-10-21 18:38:26.549 VFX Tracker[2249] *** Uncaught exception: <NSInternalInconsistencyException> Invalid parameter not satisfying: !newCells || ([newCells count] == _numCols)
Hm... I don't understand what this is telling me. I googled the error and found some archive info on how I need to explicitly state the number of columns for the matrix but 1) I can't see how this would be an issue in this case and 2) even if it is I don't see what I can do that, as it's usually done when allocing the matrix, which has be done before passing into this method?
Anyway, TIA...
~j~
James Tichenor
VFX Supervisor
AIM: email@hidden
(07779) 256 103
http://www.lehopictures.com/the_joint/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden