Note that there are some explanatory texts on larger screens.

plurals
  1. POcoredata problem nsurl may not respond to stringByAppendingPathComponent
    primarykey
    data
    text
    <p>I had some problems after starting a new coredata project with the xcode 3.2.5... my previous projects with core data (in previous xcode) worked fine, so I dont know what is the difference??</p> <p>so the error I get when I build and go to the view that calls the core data is></p> <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter' </code></pre> <p>the strange thing is that in my *AppDelegate.m, in (edited thanks Rog but still not working!)</p> <pre><code>- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator_ != nil) { return persistentStoreCoordinator_; } NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"staff.sqlite"]; NSURL *storeUrl = [NSURL fileURLWithPath:storePath]; //new position for the storeUrl! // Put down default db if it doesn't already exist NSFileManager *fileManager = [NSFileManager defaultManager]; if (![fileManager fileExistsAtPath:storePath]) { NSString *defaultStorePath = [[NSBundle mainBundle] pathForResource:@"staff" ofType:@"sqlite"]; if (defaultStorePath) { [fileManager copyItemAtPath:defaultStorePath toPath:storePath error:NULL]; } } </code></pre> <p>in the </p> <pre><code> NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"staff.sqlite"]; </code></pre> <p>I get the warning</p> <pre><code>NSURL may not respond to '-stringByAppendingPathComponent' </code></pre> <p>I option + click this stringByAppendingPathComponent and get (Symbol not found!!!!)</p> <p>but in other projects I do option + click in the same and get the definition!!</p> <ul> <li>so is this warning related to my error??</li> <li>how to fix it???</li> </ul> <p>Edit, included this in my viewDidLoad</p> <blockquote> <p>NSLog(@"path= %@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]) ;</p> </blockquote> <p>which gives me in console:</p> <pre><code>path= /Users/mkss9/Library/Application Support/iPhone Simulator/4.2/Applications/2F364C20-2B87-4ABB-AA3E-FB6F7C15096F/Documents </code></pre> <p>please!, Im getting crazy !!</p> <p>thank you!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload