Related to my previous question here.
I have a path to an image in the asset library , for example:
assets-library://asset/asset.JPG?id=1000000001&ext=JPG
Now, how could I load the image from this path to a UIImage object?
Here is the code:
NSString *path = [occasion imagePath];
//temp
NSLog(@"the 2nd occasion imagePath is: %@", path);
//end
if (path != nil)
{
//UIImage *image = [UIImage imageNamed:path];
UIImage *image = [UIImage imageWithContentsOfFile:path];
image = [image imageByScalingAndCroppingForSize:CGSizeMake(36.0, 42.0)];
[[cell imageView] setImage:image];
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…