views:

114

answers:

1

Does anyone know how I should go about storing a UIImage with the version of ObjectiveRecord packaged with ObjectiveSync? (Note that the version of SQLPersistantObjects in ObjectiveRecord is older than the current version) At the moment, I am attempting to store the UIImage data as NSData:

@interface Picture : SQLitePersistentObject {
NSString *pictureId;
NSDate *updatedAt;
NSData *imageData;

UIImage *image;
}

@property (nonatomic, retain) NSString *pictureId;
@property (nonatomic, retain) NSData *imageData;
@property (nonatomic, retain) NSDate *updatedAt;

I can set the data OK, and store it in the DB, but when I select a record from the DB, I get the data as a NSCFString as opposed to NSData. Does anyone know why?

A: 

If you want to store the image in the sqlite database then , the image should be stored as BLOB type in the sqlite database

see the example :

http://www.iphonesdkarticles.com/2009/02/sqlite-tutorial-saving-images-in.html

Biranchi