• 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: Live updating NSPredicateEditorRowTemplate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Live updating NSPredicateEditorRowTemplate?


  • Subject: Re: Live updating NSPredicateEditorRowTemplate?
  • From: Guy Umbright <email@hidden>
  • Date: Sat, 13 Dec 2008 16:22:47 -0600


To close this out...

I figured it out to as good as I think it gets. The key is to call NSRuleEditor::setCriteria with nil arrays. The nil arrays force it to go to its data source (which for NSPredicateEditor is the row templates) to refill. It does reset the row to the initial value, but I don't really think there is a way around that and I think it is valid (at least easily rationalized) interface-wise that if you change the criteria mid edit of a predicate it has to reset in case your selected option vanished. Not optimal, but oh well.

Example:

[_editor setCriteria:[NSArray array] andDisplayValues:[NSArray array] forRowAtIndex: 1];

On Dec 8, 2008, at 8:58 PM, Peter Ammon wrote:


On Dec 8, 2008, at 6:37 PM, Guy Umbright wrote:

I am trying to create an NSPredicateEditorRowTemplate with its last view a popup that contains a list of things (elsewhere in the window) that can be updated while the editor is being displayed. I can get it so that I can add an instance of the template, update the list of items and add another instance which shows the updated list, but the original does not update.

For example, the original templates specifies A,B,C in the last popup. I add a row with that template then I add a D to the list of items and then add another row to the Predicate Editor. This new row will show me a list of A,B,C,D but the original row still just shows A,B,C.

Is there a way to resync that existing row with the new list of items in its source template? Am I going to have to remove and re- add the row programmatically?

You should call -[NSPredicateEditor setRowTemplates:] with an array containing the new template (but not the old one). If you want to preserve the predicate, you may have to save off the predicate via - objectValue, and then set it back; or alternatively calling reloadCriteria should work.


-Peter


_______________________________________________

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: 
 >Live updating NSPredicateEditorRowTemplate? (From: Guy Umbright <email@hidden>)
 >Re: Live updating NSPredicateEditorRowTemplate? (From: Peter Ammon <email@hidden>)

  • Prev by Date: Drawing NSTextFieldCell subclass in table view
  • Next by Date: Re: open package installer in bundle resources directory not working
  • Previous by thread: Re: Live updating NSPredicateEditorRowTemplate?
  • Next by thread: Programmatically adding an NSTableView to another view
  • Index(es):
    • Date
    • Thread