• 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: NSRuleEditor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRuleEditor


  • Subject: Re: NSRuleEditor
  • From: Peter Ammon <email@hidden>
  • Date: Wed, 23 Jan 2008 14:55:48 -0800

Hi Jarret,

Apologies for missing your question on Sunday. I'll answer it now. You asked:

[NSExpression expressionForKeyPath:[... lookup to get dynamic keypath string here ...]]

The new NSPredicateEditor view is a convenience dream, and the app works beautifully, but the left PopUpButton button that is rendered in the NSPredicateEditor view contains the literal key path "someKeyPath". In IB, it's easy to double-click on the pop-up button in the row template and provide a user-friendly substitution like "Not A Key Path Accessor".

Is there an efficient way to do this in code when I'm creating my row templates, or should I be subclassing NSPredicateEditorRowTemplate to override templateViews?

NSPredicateEditorRowTemplate is a bit like a view factory, and you can modify the views after they are made. To change the title of a menu item in the first popup, just do it like you normally would, e.g.:


NSPopUpButton *popup = [[template templateViews] objectAtIndex:0];
[[popup itemAtIndex:0] setTitle:@"New title"];

The "PhotoSearch" sample on Apple's site demonstrates how to use an NSPredicateEditor. There's not a finished NSRuleEditor sample yet, but I have a nearly-finished one which I gave to Martin, and I will be glad to send it to anybody who e-mails me offline.

-Peter

On Jan 23, 2008, at 5:42 AM, Jarret Hardie wrote:

Heh heh heh... you're not alone in hearing the crickets chirp. I don't think a lot of folks have had much opportunity to play with these new gems. I asked a question the other day about NSPredicateEditor which has had few takers either, and eventually ended up solving using guess and test.

1. I can't find any code sample either, though if you have access to the ADC on iTunes videos (http://developer.apple.com/ adconitunes/), there is a great session from the 2007 Foundational Sessions called "Beyond Buttons and Sliders - Complex Controls in Cocoa" that devotes about 30 minutes to discussing NSRuleEditor and NSPredicateEditor.

2. I noticed that too. I suspect they're coming :-)

Cheers,
Jarret



On 22-Jan-08, at 10:54 PM, Gonzalo Castro wrote:

Two good questions below and all I hear is crickets chirping.
Will an NSRuleEditor show up in IB's Library palette?

Gonzalo

Date: Fri, 11 Jan 2008 19:06:33 +0100
From: Martin <email@hidden>
Subject: NSRuleEditor
To: Cocoa Dev <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Hi,

1. Is there any code example using NSRuleEditor (not a
NSPredicateEditor, but an actual NSRuleEditor)?
2. Is it a bug on my system or the "Rule and Predicate Editor
Programming Topics" guide is actually not yet available although it is
listed as a companion guide in the NSRuleEditor class reference?


Thanks,
Martin.
_______________________________________________

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

_______________________________________________

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

_______________________________________________

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: 
 >Re: NSRuleEditor (From: Gonzalo Castro <email@hidden>)
 >Re: NSRuleEditor (From: Jarret Hardie <email@hidden>)

  • Prev by Date: Re: NSRuleEditor
  • Next by Date: Problem binding NSProgressIndicator maxValue to array.@count
  • Previous by thread: Re: NSRuleEditor
  • Next by thread: beginSheet:ModalForWindow:modalDelegate:didEndSelector:contextInfo: in Leopard
  • Index(es):
    • Date
    • Thread