Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data: How do you count records in a persistent store?



This is a very simple question, yet I keep screwing it up.

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

I've been trying to use the '@count' qualifier to determine if I have data
in a particular MO entity:


(gdb) po [[[[[managedObjectContext persistentStoreCoordinator]
managedObjectModel] entities] objectAtIndex:6] valueForKey:@"name.@count"]


Program received signal SIGTRAP, Trace/breakpoint trap.
0x92902340 in _NSRaiseError ()
2006-04-02 11:12:15.092 eWorld[630] An uncaught exception was raised
2006-04-02 11:12:15.093 eWorld[630] [<NSEntityDescription 0x3826150> valueForUndefinedKey:]: this class is not key value coding-compliant for the key name.@count.
2006-04-02 11:12:15.094 eWorld[630] *** Uncaught exception: <NSUnknownKeyException> [<NSEntityDescription 0x3826150> valueForUndefinedKey:]: this class is not key value coding-compliant for the key name.@count.
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (objc_msgSend) will be abandoned.
(gdb)



Regards,

Ric.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.