Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.
Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.
- Subject: Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.
- From: Kyle Sluder <email@hidden>
- Date: Mon, 7 Sep 2009 10:32:45 -0700
On Sep 7, 2009, at 10:20 AM, Joshua Garnham
<email@hidden> 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 {
NSArray *selectedRow = [treeController selectedObjects];
As you noticed, this returns an array, not a single object.
NSInteger childrenCount = [selectedRow.children count];
Which makes this line suspect. An array doesn't have children. Didn't
the compiler issue an error/warning here? If not, you'll probably want
to turn on all warnings and treat warnings as errors. Those options
are so frequently used I think they should be the standard behavior.
--Kyle Sluder
_______________________________________________
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