Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Joshua Garnham
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

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Steven Degutis
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

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Joshua Garnham
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:

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Kyle Sluder
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

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Joshua Garnham
This. - (IBAction)remove:(id)sender { NSArray *selectedRow = [treeController selectedObjects]; NSInteger childrenCount = [selectedRow.children count]; if ([childrenCount != 0]) { NSLog(@Display Alert); }else{ NSLog(@Delete Imediately); } }

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Volker in Lists
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.

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Kyle Sluder
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 {