私はここで迷っています。メソッドで UIImage オブジェクトを初期化しようとしています。ドキュメントのディレクトリなどを見て、キャッシュしないことを理解しています...
それぞれの URL またはパスを指定しますが、オブジェクトは常に nil です。この方法は決して成功しません。私のパスには常に先頭にファイルプレフィックスが含まれているためですか? このような?
ファイル:// .somedir/somedir/etc.../filename.jpg
この呼び出しで docs ディレクトリを取得してパスを作成します
//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];
次に、パス文字列を作成します。