title: Cocoa error (256)
body: <p>I am using core data in my source-code for data persistence. The framework is being used to persist some preferences in my RSS feed app across different devices all linked to the same iCloud account.</p>
  
  <pre><code>    -(id)init{
         if (self= [super init]) {
             model= [NSManagedObjectModel mergedModelFromBundles:nil];
  
             NSPersistentStoreCoordinator *psc= [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model];
  
                NSError *error= nil;
                NSString *dbPath=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
               [dbPath stringByAppendingPathComponent:@"feed.db"];
                NSLog(@"%@",dbPath);
                NSURL *dbURL= [NSURL fileURLWithPath:dbPath];
  
              if (![psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:dbURL options:nil error:&amp;error]) {
                 [NSException raise:@"Open failed" format:@"Reason: %@",[error localizedDescription]];
               }
  
               context= [[NSManagedObjectContext alloc] init];
               [context setPersistentStoreCoordinator:psc];
  
               [context setUndoManager:nil];
            }
            return self;
      }
  </code></pre>
  
  <p>Error in the console—</p>
  
  <pre><code>  2015-05-08 23:15:03.963 Nerdfeed4[1023:22906] CoreData: error: -     addPersistentStoreWithType:SQLite configuration:(null) 
  
    URL:file:///Users/Rahul/Library/Developer/CoreSimulator/Devices/28EDC37B-E3AA-  442F-A1B1-72AD385563D5/data/Containers/Data/Application/BF11CCC0-0B2C-4537-BAB6-  E27E2C84CC4C/Documents/ options:(null) ... returned error Error    Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa     error 256.)"
  
      UserInfo=0x7a092c70 {NSUnderlyingException=unable to open database   file,      
  
      NSSQLiteErrorDomain=14} with userInfo dictionary {
      NSSQLiteErrorDomain = 14;
      NSUnderlyingException = "unable to open database file";
    }
    2015-05-08 23:15:03.977 Nerdfeed4[1023:22906] *** Terminating app due to  uncaught exception 'Open failed', reason: 'Reason: The operation couldn’t be   completed. (Cocoa error 256.)
  </code></pre>
  
  <p>Clearly from the error,one can figure out that the execution stops at the "if(![psc addPersistentStoreWithType:.. configuration:.. URL:.. options:..error]) " because this message returns 0 for the exception to be thrown.  How do i resolve this.. Pls assist. I do a clean build each time before the project is run.</p>