开发者_C百科Now I am on Three20.. I am using Two image source for loading image..That means
One Type of image from LOcal folder.ie from application folder Other is from url.. My problem is i dont know how to load image from local folder..and display it...
My code is given below...
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:mpngPath];
if(fileExists==YES)
{
NSLog(@"image is present");
//load and display??
}
else {
NSLog(@"image is not present");
}
Like this:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"filename" ofType:@"png"]];
Replace the url with your photo path. I assume that you save your images in your document directory.
[NSString stringWithFormat:@"documents://%@",yourPhotoName];
精彩评论