In ios7 we can write images in the directory of documents and can use them without any problems. In iOS 8, I am able to write and access documents in documents. The location of the image folder varies every time when I run an app on the simulator. I went through many stack overflow queries and technical note (link :) of apple, but I did not find any solution. Actually I found the path of images
Looks like you're completely storing the path.
Apple has changed the directory structure in iOS 8. Intrinsically expanded folders of the document internally (like some / developer / data / some random number sequences). The directory folders change on every build, if you store the full path in your SQLite, then you have not found any file in the location because the document directory location has changed.
The solution does not store the complete path, just when using the database, images from the document directory, images only prefixes it with the current application document directory, you can reach the images you have Archive: NSString * imagePathString = [NSString stringWithFormat: @ "/% @ /% @. Png", @ @
Example:
"Your Folder Name", @ "Image name"]; // Store this image path. String in the database / retrieving images NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString * documentsPath = [path objectAtIndex: 0]; NSString * filePath = [document path stringbappingpathcompany: imagePathString]; // This is the path to your images
Comments
Post a Comment