• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTreeController and insertObject:atIndex question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Problems with authorization (error -60002, errAuthorizationInvalidRef)
  • Next by Date: Re: Where are the boundaries of Cocoa and how are the boundaries perceived ?
  • Previous by thread: Re: Distributed Objects nsproxy object problem
  • Next by thread: Cocoaheads Lake Forest meets at 7pm, as the body said, not 10pm, like the subject said.
  • Index(es):
    • Date
    • Thread