このコード行を使用しようとしています
[UIImagePNGRepresentation(image, 1.0) writeToFile:pngPath atomically:YES];
しかし、明らかに pngPath は宣言されていません。だから私は使用する必要がありますstringByAppendingPathComponent
。
私はこれの例をグーグルで検索しました、そして私はこれを見つけました
myPlistPath = [documentsDirectory stringByAppendingPathComponent:
[NSString stringWithFormat: @"%@.plist", plistName] ];
[myPlistPath retain]
;
問題は、必要がないため、plist ファイルがないことです。これらすべての問題を解決し、UIImage 画像を writeToFile にするにはどうすればよいですか?