• 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
CoreData and ManagedObjects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: CoreData and ManagedObjects
      • From: mmalcolm crawford <email@hidden>
    • Re: CoreData and ManagedObjects
      • From: Wain <email@hidden>
  • Prev by Date: Re: NSImages are killing my WindowServer
  • Next by Date: Re: NSView as dataCell in TableView
  • Previous by thread: Re: Changing the sender of an <NSTextAttachmentCell>
  • Next by thread: Re: CoreData and ManagedObjects
  • Index(es):
    • Date
    • Thread