という名前の画像がありmy-image
ます。この画像をアプリケーションバンドルに保存できますか?はいの場合、コードまたはパスを教えていただけますか。
今のところ、私は次のコードを持っています–
NSData * imageData = UIImagePNGRepresentation(userSavedImage); //convert image into .png format.
NSFileManager * fileManager = [NSFileManager defaultManager];//create instance of NSFileManager
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //create an array and store result of our search for the documents directory in it
NSString * documentsDirectory = [paths objectAtIndex:0]; //create NSString object, that holds our exact path to the documents directory
NSString * fullPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png",txtImageName.text]]; //add our image to the path
[fileManager createFileAtPath:fullPath contents:imageData attributes:nil]; //finally save the image
NSLog(@"image saved");
しかしそれは節約しています
/Users/tsplmac01/Library/Application Support/iPhone Simulator/4.3/Applications/BC5DE1D8-B875-44BC-AC74-04A17329F29A/.
&アプリケーションバンドルには含まれていません。どうすればいいのか教えてください。