My app gives the user to choose an image as background to his occasion.The image source could be:
1. From the app bundle and then I would save the user selection to the occasion object's
Code:
[occasion imagePath]
which is an NSString file name for example image1.png
2. From the photo library and then I would save the NSURL after converting it to an NSString, also to the
Code:
[occasion imagePath]
for exampele
Code:
assets-library://asset/asset.JPG?id=1000000002&ext=JPG
Now my question is: How to load the image from the photo library to a UIImage instance using that path in the 2nd case?
I tried
Code:
NSString *path = [occasion imagePath];
if (path != nil)
{
UIImage *image = [UIImage imageWithContentsOfFile:path];
}
but it didn't load the image.