NSTreeController and insertObject:atIndex question.
NSTreeController and insertObject:atIndex question.
- Subject: NSTreeController and insertObject:atIndex question.
- From: Scott Andrew <email@hidden>
- Date: Mon, 1 Oct 2007 23:23:22 -0700
I have a NSTreeController. Its content is bound to my document class
to get the NSArray behind the top level of the tree. When my
windowController gets a command to import a movie I do the following..
-(IBAction)importMovie:(id)sender
{
NSMutableArray* array = [self
mutableArrayValueForKeyPath:@"document.project"];
if (array != nil)
{
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
if ([openPanel runModalForTypes:[QTMovie movieFileTypes:0]] ==
NSOKButton)
{
QTMovie* movie = [QTMovie movieWithFile:[openPanel filename]
error:NULL];
VAMovieNode* movieNode = [VAMovieNode withMovie:movie];
[array insertObject:movieNode atIndex:0];
}
}
}
Then my document has the following call to do some document specific
stuff, right now its stubbed... The idea behind this is that the movie
can create the basic items but there are some very specific things,
like undo, that the document can handle.
- (void)insertObject:(VATreeNode *)transaction
inProjectAtIndex:(unsigned int)index
{
// implementation specific code
return;
}
I have also tried..
-(void)insertProject:(NSArray *)objects atIndexes:(NSIndexSet*)index
However when i place break points into these calls they are never
hit.. Are the insert calls different for NSTreeController?
Scott Andrew
_______________________________________________
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