title: Check if file exists at URL instead of path
body: <p>How can I check if a file exists at a URL (instead of a path), in order to set a pre-populated default store into the iPhone Simulator: </p>
  
  <pre><code>NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"Food.sqlite"];
  /*
   Set up the store.
   For the sake of illustration, provide a pre-populated default store.
   */
  NSFileManager *fileManager = [NSFileManager defaultManager];
  // If the expected store doesn't exist, copy the default store.
  if (![fileManager fileExistsAtPath:storePath]) {
      NSString *defaultStorePath = [[NSBundle mainBundle] pathForResource:@"Food" ofType:@"sqlite"];
      if (defaultStorePath) {
          [fileManager copyItemAtPath:defaultStorePath toPath:storePath error:NULL];
      }
  }
  </code></pre>
  
  <p>I've read that in recent versions of the templates, the applicationDocumentsDirectory method returns an URL, so I've changed the code to use NSURL objects to represent the file path. But at <code>[fileManager fileExistsAtPath:storePath]</code>, I need to change <code>fileExistsAtPath</code> to something like <code>fileExistsAtURL</code> (obviously it doesn't exist).</p>
  
  <p>I've checked the NSFileManager Class Reference and I didn't find any suitable task suited for my purpose.</p>
  
  <p>Any hints please?</p>