• 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: Reference to entity name in NSPredicate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reference to entity name in NSPredicate?


  • Subject: Re: Reference to entity name in NSPredicate?
  • From: Z Rosen <email@hidden>
  • Date: Tue, 15 Nov 2005 17:32:23 -0800

entity is not a valid key


-Z

On Nov 15, 2005, at 4:13 PM, The Karl Adam wrote:

[NSPredicate predicateWithFormat:@"entity.name == \"blue_folder\""];

On 11/15/05, Z Rosen <email@hidden> wrote:
Is there any way to do it without adding additional data?

If the blue_folder entity has a key 'blue_data', can the predicate
exclude objects that have a blue_data key (without throwing an
exception, obviously). In short, can a predicate check if a key exists?


As a last resport, would it be insane to override -[NSArrayController
fetchWithRequest:merge:error] to search each child entity
individually and merge the results?

-Z



On Nov 15, 2005, at 3:35 PM, Scott Stevenson wrote:


On Nov 15, 2005, at 3:07 PM, Z Rosen wrote:

Now, say I want to exclude the blue_ folders.  It would be nice if
I could just say:

NSPredicate *blueFolderPredicate = [ NSPredicate
predicateWithFormat:@"entity.name LIKE %@", @"blue_folder" ];
[ allMyFolders setFetchPredicate:[ NSCompoundPredicate
notPredicateWithSubpredicate:blueFolderPredicate ] ];

.. but (of course) entity is not a valid key.


Any ideas?

Create an attribute that describes the type of each instance.


- Scott

--
http://theocacao.com/


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: 40reelintelligence.com

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Reference to entity name in NSPredicate? (From: Z Rosen <email@hidden>)
 >Re: Reference to entity name in NSPredicate? (From: Scott Stevenson <email@hidden>)
 >Re: Reference to entity name in NSPredicate? (From: Z Rosen <email@hidden>)
 >Re: Reference to entity name in NSPredicate? (From: The Karl Adam <email@hidden>)

  • Prev by Date: CoreData and Distinct
  • Next by Date: Re: NSArrayController: add an object without selecting?
  • Previous by thread: Re: Reference to entity name in NSPredicate?
  • Next by thread: Dictionary to an invisible file
  • Index(es):
    • Date
    • Thread