I have nearly finished my application that works well on iOS4, however when loading it into the 3.2 simulator it crashes with..
2010-12-21 07:54:32.052 App[14044:207] *** -[NSPathStore2 URLByAppendingPathComponent:]: unrecognized selector sent to instance 0x4d2b640
2010-12-21 07:54:32.054 App[14044:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPathStore2 URLByAppendingPathComponent:]: unrecognized selector sent to instance 0x4d2b640'
I am getting the application Document Directory with
NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"App.sqlite"];
- (NSURL *)applicationDocumentsDirectory {
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
Any help would be great, thanks.
Used
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *myPathDocs = [documentsDirectory stringByAppendingPathComponent:@"app.sqlite"];
NSURL *storeURL = [NSURL fileURLWithPath:myPathDocs];
Thanks Justin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With