读书人

How can I get a writable path on th

发布时间: 2012-07-01 13:15:00 作者: rapoo

How can I get a writable path on the iPhone?

原文链接:http://stackoverflow.com/questions/1567134/how-can-i-get-a-writable-path-on-the-iphone

?

NSString *filePath = [cachePath stringByAppendingPathComponent:@"SomeTmpFile.png"];?

Use that path for reading or writing.

Note that you can make subdirectories in either of those writable paths, which one of the example string above is using (assuming one has been created).

If you are trying to write an image into the photo library, you cannot use file system calls to do this - instead, you have to have a UIImage in memory, and use the?UIImageWriteToSavedPhotosAlbum()function call defined by UIKit. You have no control over the destination format or compression levels, and cannot attach any EXIF in this way.

读书人网 >Iphone

热点推荐