• 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
Custom canRemove binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Custom canRemove binding
      • From: Allan Odgaard <email@hidden>
    • Re: Custom canRemove binding
      • From: ian <email@hidden>
    • Re: Custom canRemove binding
      • From: Raphael Sebbe <email@hidden>
    • Re: Custom canRemove binding
      • From: Chris Giordano <email@hidden>
  • Prev by Date: Re: The current keyboard icon?
  • Next by Date: SOLVED: The position of the insertion point in an NSTextView?
  • Previous by thread: Re: NSTableView updating single cells
  • Next by thread: Re: Custom canRemove binding
  • Index(es):
    • Date
    • Thread