• 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
Counting instances in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Counting instances in Core Data


  • Subject: Counting instances in Core Data
  • From: Steve Cronin <email@hidden>
  • Date: Tue, 29 Apr 2008 11:03:11 -0500

Folks;

I want to obtain a count of instances for a specific entity in stored in Core Data (SQLite)
In the archive I find this:


________________
FROM : mmalcolm crawford
DATE : Sun Apr 02 21:21:45 2006
On Apr 2, 2006, at 11:16 AM, Frederick C. Lee wrote:

> How do you count (or determine empty) data from a persistent store (table)?

Execute a fetch for the entity in which you're interested, and count the returned array.
________________


My question is: what is the most efficient fetch to pose given that every fetch is IO.
A given entity might have a lot of records so an array COULD be an unnecessarily large transaction...


Is there a best practice fetch for this 'get a count' purpose?
Steve
_______________________________________________

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


  • Follow-Ups:
    • Re: Counting instances in Core Data
      • From: Adam Swift <email@hidden>
    • Re: Counting instances in Core Data
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Failure on unarchiving a NSBezierPath
  • Next by Date: Re: NSTableView calls setPlaceHolderString: for image cell
  • Previous by thread: Core Animation Caching Resolution
  • Next by thread: Re: Counting instances in Core Data
  • Index(es):
    • Date
    • Thread