NSError *error = nil;
NSURL *url = [NSURL URLWithString:[imageLinks objectAtIndex:0]];
NSData *tdata = [NSData dataWithContentsOfURL:url options:NSDataReadingUncached error:&error];
if (error) {
NSLog(@"%@", [error localizedDescription]);
}else {
// no error, this one is being called within my app
NSLog(@"Data loaded successfully");
}
self.pictureView1.image = [UIImage imageWithData:tdata];
UIImage
jpeg ファイルがあるので、URL コンテンツが正常に収集されていることを確認できますが、画像データをアプリに入れようとすると失敗します。NSData が使用可能であることを確認するためのチェックがあるのだろうかUIImage
。
また、この失敗の原因と、それを防ぐ方法もわかりません。どんな助けでも大歓迎です。