CoreData and ManagedObjects
CoreData and ManagedObjects
- Subject: CoreData and ManagedObjects
- From: "Bobby B" <email@hidden>
- Date: Thu, 23 Mar 2006 16:10:32 -0400
Hello everyone!
I'm building a CoreData application, and I'm having some trouble
accessing the properties of my entities. From what I've been reading,
it seems to access a CoreData entity and it's properties (as keys),
you do the following:
NSData * myData = [NSData dataWithContentsOfFile:[op filename]];
NSManagedObjectContext * context = [[NSApp delegate]
managedObjectContext]; NSManagedObject * girlEntity =
[NSEntityDescription entityForName: @"Girl" inManagedObjectContext:
context];
[girlEntity setValue:myData forKey: @"image"];
[girlEntity didChangeValueForKey:@"image"];
(I've also tried, in place of context, [self [managedObjectContext])
My Entity in xcdatamodel is "Girl", and it has a property called
"image" that is set to "Binary." I have the above code in a "load
picture" action. When the user clicks "load button", it does the
above code, plus setting the image outlet to the correct picture (via
the myData).
However, when I go to the next record, then come back, the image is
still set as the original image. It seems that I'm not getting my
changes to "stick".
Any ideas?
Thank you everyone,
Bobby
_______________________________________________
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