• 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
Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children. (From: Joshua Garnham <email@hidden>)
 >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>)
 >Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children. (From: Joshua Garnham <email@hidden>)

  • Prev by Date: Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.
  • Next by Date: Re: Does Mac OS X support interior pointers?
  • Previous by thread: Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.
  • Next by thread: Re: Copying records from to-many relationship in Core Data
  • Index(es):
    • Date
    • Thread