Questions tagged [nspredicateeditor]

NSPredicateEditor is a Cocoa class derived from the NSRuleEditor to allow creating simple or complex rules.

NSPredicateEditor is a subclass of NSRuleEditor that is specialized for editing NSPredicate objects.

From Apple NSPredicateEditor class reference document NSPredicateEditor provides an NSPredicate property —objectValue that you can get and set directly, and and can bind using Cocoa bindings . NSPredicateEditor depends on another class, NSPredicateEditorRowTemplate, that describes the available predicates and how to display them.

enter image description here

Related Question in Stack Overflow:

  1. How to use NSPredicate with NSPredicateEditor on different data (Multiple Predicates?)

  2. User-friendly way of nesting predicates in NSPredicateEditor?

67 questions
8
votes
2 answers

Variable Substitution with FetchRequests stored in a CoreData Model

I've always created my NSFetchRequests entirely in-code. Now I'm looking at the Xcode GUI for building a fetch request and storing it in the model. I'm following an example from the Xcode Documentation. I added a Fetch Request to my model, and the…
Woodster
  • 3,451
  • 3
  • 17
  • 19
7
votes
4 answers

NSPredicateEditor in Xcode 4

Bit of an issue with Xcode 4's predicate editor controls - I think I'm doing everything right, and it really seems like the IDE itself is busted. I'm having this issue in an app I'm writing, but to isolate it, I did the following: Create a new…
Nick Locking
  • 2,147
  • 2
  • 26
  • 42
7
votes
2 answers

NSPredicateEditorRowTemplate for date comparison

I'm building an NSPredicateEditor, and I want the ability to do advanced date comparison. I realize that I can build an NSPredicateEditorRowTemplate with a rightExpressionType of NSDateAttributeType, but the predicates I want to build need to be…
Dave DeLong
  • 242,470
  • 58
  • 448
  • 498
7
votes
0 answers

User-friendly way of nesting predicates in NSPredicateEditor?

An NSPredicateEditor can be set in compound mode, using the IB or in code [predicateEditor setNestingMode:NSRuleEditorNestingModeCompound]; The user can then hold the 'option' key to add another compound line, to generate complex filters like ((A…
Carelinkz
  • 936
  • 8
  • 27
6
votes
0 answers

How to Mimic Finder NSPredicateEditor leftExpression list

I would like to mimic the Finder's predicatesList. Especially the LeftExpressions popup with its "other" (in German: "Andere...") menu entry and like to popup a NSSheet with a user selectable list of search predicates. My approach was to create…
ThorstenC
  • 1,264
  • 11
  • 26
6
votes
4 answers

NSPredicateEditor & NSExpression - Can the display be different than the value for the predicate?

I have a predicate editor, which the template was generate via the following: NSArray * test = [NSArray arrayWithObjects: [NSExpression expressionForKeyPath: @"Abc"], [NSExpression…
Kyle
  • 17,317
  • 32
  • 140
  • 246
5
votes
1 answer

Does anything like NSPredicateEditor exist for iOS?

As far as I know NSPredicateEditor isn't available for iOS. But has anyone created something similar for iOS? I imagine it would be fairly difficult UI wise since the screen is much smaller but I don't see why it wouldn't be possible in theory.
Steve Moser
  • 7,647
  • 5
  • 55
  • 94
5
votes
1 answer

Forcing the display of a compound row with NSPredicateEditor

I'm creating an NSPredicateEditor in code and trying to achieve what I had hoped would be a fairly simple task. Basically, I would like to display a compound NSPredicateEditorRowTemplate (giving the user the option to perform matches when…
ndg
  • 2,585
  • 2
  • 33
  • 58
5
votes
1 answer

Merging multiple localized left key paths in the same NSPredicateEditorRowTemplate?

I'm attempting to replicate the Finder's NSPredicateEditor-based metadata search in an app. I'd prefer to get the Finder's exact NSPredicateEditor for free, but unless anyone has a better answer for that question it looks like I'm going to have to…
pkamb
  • 33,281
  • 23
  • 160
  • 191
4
votes
1 answer

Adding Variables in xCode 4's predicate editor

I can't seem to find a way to add a fetch result with a variable in the new xCode4's editor... I've looked every where... every right click, menu item, everything... Anyone knows how to do this?
Alex Zak
  • 1,924
  • 2
  • 18
  • 26
3
votes
2 answers

Using NSPredicate to analyze strings

Howdy! This question is pretty long so be sure to have a seat first :) At one point in my code I get a string from the user, and I analyze that string. By analyzing I mean going through every character and mathcing it against a predicate the user…
Alex
  • 5,009
  • 3
  • 39
  • 73
3
votes
2 answers

NSPredicateEditorRowTemplate, specifying of Key Path with spaces?

As per a previous question, I have reluctantly given up on using IB/Xcode4 to edit an NSPredicateEditor and done it purely in code. In the GUI way of editing the fields, key paths can be specified with spaces, like 'field name', and it makes them…
Nick Locking
  • 2,147
  • 2
  • 26
  • 42
3
votes
0 answers

NSPredicateEditorRowTemplate with a custom view, predicateWithSubpredicates not being called

In my app I need to be able to filter items by colours. I've subclassed the NSPredicateEditorRowTemplate and added custom view : *Custom view is NSView with 7 NSButtons My problem is that predicateWithSubpredicates: gets called only when I…
CryingHippo
  • 5,026
  • 1
  • 28
  • 32
3
votes
1 answer

Automatically generated predicate row templates for to-many key?

In my Core Data managed object model, I have an entity Foo with a to-many relationship (with a to-many inverse) to entity Baz named baz. Baz has a string property named "tag". When I use [NSPredicateRowEditorTemplate…
Barry Wark
  • 107,306
  • 24
  • 181
  • 206
3
votes
1 answer

NSPredicate for evaluating a String

How do I evaluate a string using NSPredicate? I have used NSPredicateControl and String manipulations to get something like, N92 BEGINSWITH[cd] "n". I want to evaluate this to get a True/False value. How do I get that? Any suggestions ?
1
2 3 4 5