重複の可能性:
iOS のダウンロードとアプリ内の画像の保存
ファイルをダウンロードしたい。私はこれを見つけました
[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://lasp.colorado.edu/home/wp-content/uploads/2011/03/suncombo1.jpg"]]
私の質問は次のとおりです。
ファイルはどこに保存されますか?
スレッドを使用して、ダウンロード用のステータス バーを構築することは可能ですか?
ファイルを保存するためにメモリ(内部/外部)を変更する方法はありますか?
今、私は使用しています
NSData *dataImage = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://lasp.colorado.edu/home/wp-content/uploads/2011/03/suncombo1.jpg"]];
downloadStatus.text =@"size: %zd", malloc_size(dataImage);
結果は常に 32 です。これが実際の画像のサイズではないでしょうか。