PDA

View Full Version : Saving data in a table cell




ljg93
May 31, 2011, 12:14 PM
Hey everyone,

I am using code from the PhotoPicker Sample Code. I basically put the photo picker inside of a table view cell so when a user clicks on a cell they can select a photo that goes along with that cell so for example

First Table View Section-Second Table View Section- Detailed Section (where user can select a photo to be saved on this page)

I was wondering how I can get the photo selected by the user to be saved in the cell.



bweberapps
May 31, 2011, 05:04 PM
You could try storing the picture in a core data table using the transformable type, and add a UIImage to Data Transformer class. I found an example in one of Apple's examples, but I can't seem to find it now. Use the core data table to populate your table view. Hope this puts you in the right direction.

seepel
Jun 4, 2011, 06:07 PM
You could try storing the picture in a core data table using the transformable type, and add a UIImage to Data Transformer class. I found an example in one of Apple's examples, but I can't seem to find it now. Use the core data table to populate your table view. Hope this puts you in the right direction.

I would caution against storing binary data in Core Data. I tried this once thinking "How much slower can it make my database?" Well it gets pretty darned slow. It'd be better to store the name of the image in the Core Data database and then write the image to disk.