I had problems after starting a new coredata project with xcode 3.2.5 ... my previous projects with the main data (in the previous xcode) worked fine, so I donβt know what the difference is?
so the error that I get when I create and go to the view that calls the main data is β
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
it is strange that in my * AppDelegate.m, in (edited thanks to Rog, but still does not work!)
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator_ != nil) { return persistentStoreCoordinator_; } NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"staff.sqlite"]; NSURL *storeUrl = [NSURL fileURLWithPath:storePath];
in
NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"staff.sqlite"];
I get a warning
NSURL may not respond to '-stringByAppendingPathComponent'
I option + click this line ByAppendingPathComponent and get (character not found !!!!)
but in other projects I make the option + click in the same and get the definition !!
- so is this a warning related to my error ??
- how to fix it ???
Edit, included this in my viewDidLoad
NSLog (@ "path =% @", [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) lastObject]);
which gives me the console:
path= /Users/mkss9/Library/Application Support/iPhone Simulator/4.2/Applications/2F364C20-2B87-4ABB-AA3E-FB6F7C15096F/Documents
please !, im going crazy !!
Thank you!