问题
I am working on application in which I store data of image into database like
NSString *query = [NSString stringWithFormat:@"INSERT INTO Friends_user (f_id,f_name,f_image,f_mobile) VALUES('%ld','%@','%@','%@')",(long)id_, self.txt_name.text,[UIImagePNGRepresentation(self.img_userprofile.image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength], self.txt_mobile_no.text ];
It stores Successfully but when I retrieve that data to display image, Memory Increases with every image. Here is my code to retrieve data
NSData *data = [[NSData alloc]initWithBase64EncodedString:[[arr_friendList objectAtIndex:indexPath.row] objectAtIndex:2] options:NSDataBase64DecodingIgnoreUnknownCharacters];
img_friend_profile.image= [UIImage imageWithData:data];
[theAppDelegate.dbManager executeQuery:query];
My Datatype in database is BLOB.
Memory increases Upto 10-20 MB per image. Please Help me with it
Thank you
来源:https://stackoverflow.com/questions/39995156/memory-increase-while-retriving-data-from-database-for-loading-image