Core Data data access
Core Data data access
- Subject: Core Data data access
- From: Dan Grassi <email@hidden>
- Date: Thu, 30 Mar 2006 14:31:07 -0500
I have started a simple project with a code less Core Data
application that used a SQLite DB backend. Everything works fine.
Now I want to access the data and am having no luck. I have tried:
NSDictionary* entities = [managedObjectModel entitiesByName];
NSEntityDescription* entity = [entities valueForKey:@"Device"];
NSFetchRequest* fetch = [[NSFetchRequest alloc] init];
[fetch setEntity: entity];
NSArray* results = [managedObjectContext executeFetchRequest:fetch
error:nil];
NSEnumerator *enumerator = [results objectEnumerator];
NSManagedObject* managedObject;
while (managedObject = [enumerator nextObject])
NSLog(@"PropertyName : %@", [managedObject
valueForKey:@"PropertyName"]);
I get:
2006-03-30 14:28:24.440 ProjectName[11524] Exception raised during
posting of notification. Ignored. exception: [<NSManagedObject
0x3e0510> valueForUndefinedKey:]: this class is not key value coding-
compliant for the key PropertyName.
Surely it must be easy to get the data and even the property names.
Can someone please help?
Dan
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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