How would I do this?
The Outline View is being used with Core Data.
Cheers,
Josh.
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at
Josh,
The outline view is probably being displayed with an NSArrayController, not
just Core Data, which is an abstract term for a ton of APIs. As well,
NSArrayController falls into part of Cocoa, as well as Core Data, but that's
another story.
Assuming your row is removed via an outlet to your
Steven,
The Outline View isn't being displayed with an NSArrayController rather an
NSTreeController, but I think you can still override -remove:.
Also, how would I check to see whether the row the user wants to delete has any
children?
Cheer,
Josh.
From:
On Sep 7, 2009, at 8:14 AM, Joshua Garnham
joshua.garn...@yahoo.co.uk wrote:
How would I do this?
http://www.whathaveyoutried.com
--Kyle Sluder
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or
This.
- (IBAction)remove:(id)sender {
NSArray *selectedRow = [treeController selectedObjects];
NSInteger childrenCount = [selectedRow.children count];
if ([childrenCount != 0])
{
NSLog(@Display Alert);
}else{
NSLog(@Delete Imediately);
}
}
Hi,
NSArray *selectedRow = [treeController selectedObjects];
you get an NSArray - so you should enumerate through the objects of
the array
NSInteger childrenCount = [selectedRow.children count];
Does not get the children count of anything but the NSArray, which it
doesn't have.
On Sep 7, 2009, at 10:20 AM, Joshua Garnham
joshua.garn...@yahoo.co.uk wrote:
This.
Excellent response. In the future, it is always better if you include
code or a description of your attempts (even if it's just looking at
the documentation).
- (IBAction)remove:(id)sender {