1MB? Also, I want to prevent the use开发者_C百科r having the ability to access them via some kind of hacking.You can writ" />
开发者

Correct practice for storing large images securely

开发者 https://www.devze.com 2023-03-02 17:43 出处:网络
What is the correct way to store large images on iOS, where \"large\" means > 1MB? Also, I want to prevent the use开发者_C百科r having the ability to access them via some kind of hacking.You can writ

What is the correct way to store large images on iOS, where "large" means > 1MB?

Also, I want to prevent the use开发者_C百科r having the ability to access them via some kind of hacking.


You can write the image to documents directory of your app and the paths for the images in coreData or NSUserDefaults. To prevent hacking you can encrypt the data before writing it to documents directory. For encryption look at this post.

Edit:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0]; 
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"yourFileNameAndExtension"];

Then just use the "path" NSString.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号