• 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
NSPredicateEditorRowTemplate and CoreData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPredicateEditorRowTemplate and CoreData


  • Subject: NSPredicateEditorRowTemplate and CoreData
  • From: "Carmen Cerino Jr." <email@hidden>
  • Date: Mon, 25 Jan 2010 22:16:36 -0500

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 (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

  • Prev by Date: Re: Launch process as root from cocoa app
  • Next by Date: Re: Launch process as root from cocoa app
  • Previous by thread: Re: Launch process as root from cocoa app
  • Next by thread: NSTabView
  • Index(es):
    • Date
    • Thread