• 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: counting managed objects of a certain type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: counting managed objects of a certain type


  • Subject: Re: counting managed objects of a certain type
  • From: Daniel Child <email@hidden>
  • Date: Wed, 09 Jul 2008 11:08:59 -0400

Somehow I thought a predicate was mandatory. Simply setting the entity works.

Thank you.

On Jul 9, 2008, at 2:34 AM, mmalc crawford wrote:


On Jul 8, 2008, at 11:16 PM, Daniel Child wrote:

NSManagedObjectContext *moc = [self managedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription
entityForName:@"Employee" inManagedObjectContext:moc];
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
[request setEntity:entityDescription];


....but then goes on to talk about various predicates (like "where salary is over 10000").
I simply want "all employees".


I've looked through the documentation and found "countForFetchRequest: error:"
but that still leads the question of what kind of request asks for "all objects of a certain type".


What do you think happens if you don't set a predicate?
Did you try it?

mmalc


_______________________________________________

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: 
 >counting managed objects of a certain type (From: Daniel Child <email@hidden>)
 >Re: counting managed objects of a certain type (From: mmalc crawford <email@hidden>)

  • Prev by Date: ANN: CocoaHeads NYC, Thu July 10
  • Next by Date: Re: Does this caution need fixed? (newb)
  • Previous by thread: Re: counting managed objects of a certain type
  • Next by thread: Debugging strategy - exceptions
  • Index(es):
    • Date
    • Thread