I am creating an application with iCloud. But I have some problems. It creates a directory in iCloud using NSFileWrapper, then creates an NSData file (container) in the NSFileWrapper directory. I use this code to convert NSFileWrapper to NSMutableArray:
NSFileWrapper *MyWrapper=[[[MyDocument data] fileWrappers] objectForKey:@"myFile.doh"]; NSData *MyData=[NSData dataWithData:[MyWrapper regularFileContents]]; NSMutableArray *MyList=[NSPropertyListSerialization propertyListFromData:MyData mutabilityOption:NSPropertyListMutableContainers format:nil errorDescription:nil];
And it only works correctly on the device that created this container. On other devices, the result of this code is BAD_ACCESS (in the second line of code, where I start to do something with the data). During debugging, the "regularFileContents" function returns the correct object with the correct data size, but when I try to read this data, BAD_ACEESS (code = 10) occurs.
I use ARC, so this is not a memory management error.
Maybe the problem is in some project code / code settings? Any ideas?
Thanks!
source share