Re: Counting instances in Core Data

2008-04-29 Thread Ben Trumbull
> In Tiger that was the best means available, but if you're targeting Leopard there is a better option available: Create your fetch request to fetch all instances of a given entity and execute the fetch with countForFetchRequest:error: which will simply return the number of instances/rows

Re: Counting instances in Core Data

2008-04-29 Thread Adam Swift
On Apr 29, 2008, at 11:18 AM, Adam Swift wrote: On Apr 29, 2008, at 9:03 AM, Steve Cronin wrote: 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...

Re: Counting instances in Core Data

2008-04-29 Thread I. Savant
> In Tiger that was the best means available, but if you're targeting Leopard > there is a better option available: > > Create your fetch request to fetch all instances of a given entity and > execute the fetch with countForFetchRequest:error: which will simply return > the number of instances/ro

Re: Counting instances in Core Data

2008-04-29 Thread Adam Swift
On Apr 29, 2008, at 9:03 AM, Steve Cronin wrote: 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

Re: Counting instances in Core Data

2008-04-29 Thread I. Savant
> > My question is: what is the most efficient fetch to pose given that every > > fetch is IO. > > Yes. Sorry, I thought this was "is this the most efficient" ... Meaning: mmalc's response of "Execute a fetch for the entity in which you're interested, and count the returned array." is the m

Re: Counting instances in Core Data

2008-04-29 Thread I. Savant
> 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. Yes. > A given entity might have a lot of records so an array COULD be an > unnecessar

Counting instances in Core Data

2008-04-29 Thread Steve Cronin
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