Custom canRemove binding
Custom canRemove binding
- Subject: Custom canRemove binding
- From: ian <email@hidden>
- Date: Wed, 5 May 2004 13:26:42 +0100
Hello,
I'm using an NSArrayController to populate a tableview according to the
contents of an array of objects in an instance of MyDocument for a doc
based app.
I've got add/insert/remove buttons set up and the add/insert are
enabled by binding to the array controller's selection - canAdd and
canInsert.
I'd like to prevent the user from deleting the last row in the table
however, so I bound the remove button to File's Owner (MyDocument) and
a model key path of "myCanDelete" which is the name of a method that
returns ([theArray count]>1)
Trouble is, this is called once only at startup, so the button doesn't
update.
Any ideas before I go ahead and subclass NSArrayController to override
canRemove?
Cheers
Ian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.