开发者

images form document [duplicate]

This question already has answers here: Closed 11 years ago.

i have an image in document folder. i want show it in table view. i try but what is wrong i don't know my code is

NSString *imagelist = some image name.png;  

//-----------
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUse开发者_Python百科rDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *yourFilePath = [documentsDirectory stringByAppendingPathComponent:imagelist];


UIImageView *img=[[UIImageView alloc] initWithFrame:CGRectMake(5,5,50,40)];
 // img.image=[UIImage imageWithData:imagedata];
[cell.contentView addSubview:img];


NSURL *pptURL = [NSURL fileURLWithPath:yourFilePath];
NSURLRequest *request = [NSURLRequest requestWithURL:pptURL];
[img loadRequest:request];
[cell.contentView addSubview:img];

Thank in advance


Did you look into the developer docs from Apple? There is a guide to XML programming with sample code and everything you need to know.

http://developer.apple.com/library/mac/ipad/#documentation/Cocoa/Conceptual/XMLParsing/XMLParsing.html%23//apple_ref/doc/uid/10000186-SW1

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜