デバッグに役立つ簡単なプログラムを作成しました。
#import "UIImage+saveScreenShotOnDisk.h"
@implementation UIImage (saveScreenShotOnDisk)
-(void)saveScreenshot{
NSData * data = UIImagePNGRepresentation(self);
[data writeToFile:@"foo.png" atomically:YES];
}
@end
実行後、どこにあるか知りたいfoo.png
です。
私はに行きました
~Library/Application Support
と私は見つけることができませんfoo.png
。それはどこにある?
私が行った場合
BOOL result = [data writeToFile:@"foo.png" atomically:YES];
結果は になりますNO
。これは、iPhone とは異なり、シミュレーターがどこにでも書き込むことができることを考えると、ちょっと奇妙です。