Re: NSTreeController and remove:
Re: NSTreeController and remove:
- Subject: Re: NSTreeController and remove:
- From: Joanna Carter <email@hidden>
- Date: Mon, 17 May 2010 08:30:38 +0100
Hi Tony
> Ok, here is the magical answer as to why the remove: didn't work. Nice little warning in the Cocoa Bindings Programming topic:
>
> Warning: Providing the count key path to an NSTreeController instance disables the add:,addChild:, remove:, removeChild:, orinsert: methods.
>
> My object implemented a method to retrieve the count and I set it in the controller. What the warning doesn't mention, it also causes CanAdd and CanRemove to always return no. So, if anyone is having problems with binding these methods to their buttons and they are disabled, this can also be a reason why.
Thank you for one of those superb little gems that can save so much time. I have filed it away under one of those things to remember before starting to tear my hair out :-)
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
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