images form document [duplicate]
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
精彩评论