• 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
Re: Displaying image and core data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying image and core data


  • Subject: Re: Displaying image and core data
  • From: Kubernan from 10191 Technologies <email@hidden>
  • Date: Wed, 16 Nov 2005 23:15:19 +0100


Le 16 nov. 05 à 22:10, Scott Stevenson a écrit :


On Nov 16, 2005, at 12:24 PM, Kubernan from 10191 Technologies wrote:

In my code, when the user choose a picture from an open file panel i thought i could do that :

anImage = [[NSImage alloc] initWithContentsOfFile:[filesToOpen objectAtIndex:0]];
[personalityController setValue:anImage forKeyPath:@"selection.originalPicture"];
[...]
So what should i do for storing a picture with core data and displaying it in my GUI ?
I read the apple document about binding and viewing image but i don't know if it's the good
solution to my problem.

What is the purpose of "filesToOpen"?

It contains the path of the file selected from the open panel.


To me it seems like you're unnecessarily mixing NSImage and NSData objects. You can just store the image itself in the binary attribute and connect the image view's "data" binding to the Person's "originalPicture" attribute.

My goal is to update the core data context through the controller (not directly the core data). I thought i could use
[personalityController setValue:anImage forkeyPath:@"selection.originalPicture"] but it doesn't work because
the core data is waiting for an NSData (binary attribute) not NSImage.


In IB My NSImageView bind Value is "Data = selection.originalPicture [Person Array Controller(NSArrayController)]"


<snip>

- Scott

--
http://theocacao.com/


Thanks for your help,

K. _______________________________________________
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: Displaying image and core data
      • From: Scott Stevenson <email@hidden>
References: 
 >Displaying image and core data (From: Kubernan from 10191 Technologies <email@hidden>)
 >Re: Displaying image and core data (From: Scott Stevenson <email@hidden>)

  • Prev by Date: RE: How to get Tool Tip color ?
  • Next by Date: RE: How to get Tool Tip color ?
  • Previous by thread: Re: Displaying image and core data
  • Next by thread: Re: Displaying image and core data
  • Index(es):
    • Date
    • Thread