开发者

How can get image from a path in to UITAbleViewCell?

I have the following path in NSString *path1,

/Users/srikanth/Library/Application Support/iPhone Simulator/User/Applications/9E6E8B22-C946-4442-9209-75BB0E924434/Documents/snook开发者_JAVA百科.jpg  

How can I show the image snook.jpg. I need it to show in UITableViewCell for

cell.imageView.image   

if path1 has the path. I used the following to get the last part of the path1 , snook.jpg.

NSURL *url = [NSURL URLWithString:path1];
NSString *imageString = [url path];

But, url is showing as nil.

How can I do it ? Thank you.


If you have the path then you can use the "imageWithContentsOfFile:" method of UIImage:

UIImage *img = [UIImage imageWithContentsOfFile:path];
cell.imageView.image = img;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜