IOS 7 Error creating folder after application update

I am having a real weird problem with the iOS app I'm working on right now. The effect exists only if I test the application using a special distribution. After updating the application (it must be installed earlier), it did not work correctly. I could track the error and it is caused by the following line of code:

[fileManager createDirectoryAtPath:folder withIntermediateDirectories:YES attributes:nil error:&error];

Now you can say, of course: never write to the application package, but the base path is the Documents folder through:

dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
imgDir = [docsDir stringByAppendingPathComponent:@"images"];
folder = [imgDir stringByAppendingPathComponent:md5]; // md5-Hash is created before

Full error message (logged in iphone syslog):

Domain Error = NSCocoaErrorDomain Code = 513 "The operation could not be completed. (Cocoa error 513.)" UserInfo = 0x14d44f30 {NSFilePath = / var / mobile / Applications / 280C6D36-3667-4589-A74F-42F3F17ABA71 / Documents / images / 39b6cd45a05bbbbecaaa NSUnderlyingError = 0x14d4e340 "The operation cannot be completed. The operation is not allowed"}

Interestingly, if I remove the application before installing through the ad hoc distribution (Testflight on iPhone 5 with iOS 7.0.4), the folder will be created and the application will work as expected. The only links I could find were developers who did not use stringByAppendingPathComponent or write directly in the application bundle. Maybe someone else has a problem or an idea?

+3
source
1

- , . , , , . , , . .

dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
imgDir = [docsDir stringByAppendingPathComponent:@"images"];

imgDir userPreferences, - , . , . , . , .

+1

All Articles