title: Unable to create folder inside document directory
body: <p>I developed iPhone app in which i got stuck at one point,</p>
  
  <p>What i want to do is,
  I want to copy my Database from <code>bundle</code> to <code>folder inside document directory</code> </p>
  
  <p>When i try to create folder inside <code>DocDir</code> it doesn't getting created and it shows error,</p>
  
  <p><strong>Failed to create MyDB.sql file with message 'The operation couldn’t be completed. (Cocoa error 4.)</strong></p>
  
  <p>Here is my code snippet,</p>
  
  <pre><code>    NSFileManager *fileManager = [NSFileManager defaultManager];
      NSError *error;
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
      NSString *documentsDir = [[paths objectAtIndex:0] stringByAppendingString:@"/NewFolder/"];
  
      NSString *dbPath = [documentsDir stringByAppendingPathComponent:@"MyDB.sql"];
      BOOL success = [fileManager fileExistsAtPath:dbPath];
  
      if(!success) {
  
          NSString *defaultDBPath = [[NSBundle mainBundle] pathForResource:@"MyDB" ofType:@"sql"];
  
          success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&amp;error];
  
          if (!success)
              NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
      }
  </code></pre>
  
  <p>Where i am doing mistake? please help</p>
  
  <p><strong><em>Thanks in advance.</em></strong></p>