IOSsqlite数据库储存并取出图片---by talent.L

取出图片

-(void)viewWillAppear:(BOOL)animated{

[super viewWillAppear:animated];

[[Test initData]open];

NSData * data = [[Test initData]data];

self.myimage.image = [UIImage imageWithData:data];

[[Test initData]closesqlite];

}

//二维码储存

[[Test initData]open];

Model *modle = [[Model alloc]init];

NSData *_data = UIImageJPEGRepresentation(self.myimage.image, 1.0f);

NSString *_encodedImageStr = [_data base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];

modle.img = _encodedImageStr;

[[Test initData]add:modle];

[[Test initData]closesqlite];

你可能感兴趣的:(IOSsqlite数据库储存并取出图片---by talent.L)