Programmatically adding objects to a bound outlineview
Programmatically adding objects to a bound outlineview
- Subject: Programmatically adding objects to a bound outlineview
- From: Jesus De Meyer <email@hidden>
- Date: Wed, 11 Oct 2006 14:57:35 +0200
Hi,
I have succesfully managed to list items in my outlineview, which is
bound to an NSTreeController. However, while testing my application I
had made a root object and added some children on the initmethod of
the content provider object of the NSTreeController.
But when I add an object while selecting a menu in my nib, it doesn't
work. My add method is called, but the outlineview doesn't get
refreshed, even though I do reload the data.
I'm guessing I need to do something with NSIndexPath since that's
what NSTreeController uses to find out where to put objects.
I've been looking around but haven't found a clear example on how to
use index paths. Currently my method to add an item looks like this.
docElement is the object I use as my root node.
- (IBAction)addMediaElement:(id)sender {
[docElement addChildItem:[FusionMediaElement
mediaElementWithName:@"Video" ofType:FusionMediaElementVideoType]];
[elementsOutlineView reloadData];
}
Thanks in advance,
Jesus
__________________
Jesus De Meyer
www.edot-studios.com
jesus.edot-studios.com
"creativity in mind"
_______________________________________________
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