I am trying to generate predicate editor templates for my Core Data entities. 
In my code I have the following:

        NSEntityDescription *descrip = [NSEntityDescription 
entityForName:@"Person" inManagedObjectContext:managedObjectContext];
        NSArray *templates = [NSPredicateEditorRowTemplate 
templatesWithAttributeKeyPaths:[NSArray arrayWithObjects:@"name", @"age", nil] 
inEntityDescription:descrip];
        
        [ibPredicateEditor setRowTemplates: templates];
        
        NSPredicate *p = [NSPredicate predicateWithFormat:@"name like 'John'"];
        
        [ibPredicateEditor setObjectValue:p];

Printing out the contents of the templates array gives me the following:
        <CFArray 0x1002d7400 [0x7fff70ff5f20]>{type = immutable, count = 2, 
values = (
                0 : <NSPredicateEditorRowTemplate 0x10025c090: [name] [99, 4, 
5, 8, 9] NSStringAttributeType>
                1 : <NSPredicateEditorRowTemplate 0x1002d2dc0: [age] [4, 5, 0, 
2, 1, 3] NSInteger16AttributeType>
        )}

When this code executes I get the following on the console:
        Warning - unable to find template matching predicate name LIKE "Worsley"

The interface for doing this looks extremely straight forward, so I can't seem 
to figure out what I am doing wrong. Any help would be greatly appreciated!

Cheers,
Carmen_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to