0
我迷失在这里。我尝试用该方法初始化UIImage对象。我明白,它看起来在文件目录等,并不缓存...imageWithContentsOfFile - 为什么不接受ios路径?
我提供相应的URL或路径,但对象始终为零。 该方法永远不会成功。 是否因为我的路径始终包含文件前缀? 是否这样?
文件:// .somedir/somedir的/ etc .../filename.jpg
我通过获取文档目录使用该调用
//get the documents directory path
NSURL *docsPath = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
// create the full image local path
NSString *imageLocalPath = [NSString stringWithFormat:@"%@%u.jpg", docsPath, indexPath.row + 1];
,然后构建创建路径路径字符串。