문제

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

Also, I want to prevent the user 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top