大佬教程收集整理的这篇文章主要介绍了iphone – 从文件目录加载图像,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我检查它存在于我使用的路径,它是.但没有图像出现.
这是我一直在努力:
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString *documentsDir = [documentPaths objectATindex:0]; NSString *outputPath = [documentsDir StringByAppendingPathComponent:[fileList objectATindex:indexPath.row]]; NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease]; NSString *imgPath = [[outputPath StringByreplacingoccurrencesOfString:@"mov" withString:@"png"]retain]; if ([fileManager fileExistsAtPath:imgPath]) { NSLog(@"FOUND IMG"); NSLog(imgPath); } NSData *imgData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:imgPath]]; UIImage *thumbNail = [[UIImage alloc] initWithData:imgData]; UIImageView * imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0,120,120)]; [imgView setImage:thumbNail]; [cell addSubview:imgView]; [imgView release];
FOUND IMG 2011-12-26 12:42:23.066 iGeo2[412:707] /var/mobile/Applications/1A2B0D85-CDB1-4E4B- 9509-EF68B1A0E720/Documents/0.009000.png
非常感谢,
-码
我已经尝试过其他一些方法,但没有任何出现.
以上是大佬教程为你收集整理的iphone – 从文件目录加载图像全部内容,希望文章能够帮你解决iphone – 从文件目录加载图像所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。