Can not save data in subdirectory of Documents iPhone?

Your dataPath doesn't include tileImageName You should define a tileImagePath to include the tileImageName It should probably be NSString * tileImageName = NSString stringWithFormat:@"%@%@",currentDate,@". Png"; NSString * dataPath = documentsDirectory stringByAppendingPathComponent:@"MyFolder"; NSString * tileImagePath = dataPath stringByAppendingPathComponent:tileImageName; if (!NSFileManager defaultManager fileExistsAtPath:dataPath){ NSFileManager defaultManager createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:nil; } NSData * data = UIImagePNGRepresentation(tileImage); data writeToFile:tileImagePath atomically:YES So your dataPath is something like Documents/MyFolder and not Documents/MyFolder/20110622_011700. Png as you intended.

Your dataPath doesn't include tileImageName. You should define a tileImagePath to include the tileImageName. It should probably be, NSString * tileImageName = NSString stringWithFormat:@"%@%@",currentDate,@".

Png"; NSString * dataPath = documentsDirectory stringByAppendingPathComponent:@"MyFolder"; NSString * tileImagePath = dataPath stringByAppendingPathComponent:tileImageName; if (!NSFileManager defaultManager fileExistsAtPath:dataPath){ NSFileManager defaultManager createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:nil; } NSData * data = UIImagePNGRepresentation(tileImage); data writeToFile:tileImagePath atomically:YES; So your dataPath is something like ../Documents/MyFolder and not ../Documents/MyFolder/20110622_011700. Png as you intended.

Thanks for quick reply. I will do it. How can I delete the folder so that all the data is deleted from folder?

– appDev Jun 21 at 19:48 Use removeItemAtPath:error: – Deepak Jun 21 at 19:51.

The guy from the first link (gaiagps) is complaining about having their app rejected and so, but his following blog post is telling their app data is now safe from deletion. Is it okay to save my data to /Documents (even if they're big -to ruin the iCloud user experience-), using the new component UIDocument and syncing it with iCloud storage? I would like to develop the app correctly to get accepted by the app review the first time I submit the app (if possible), to avoid any latencies.

So what I am asking is, where to save the data in iPad so it won't get deleted?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions