title: Delete file obj c
body: <p>I am creating files with the following code</p>
  
  <pre><code>NSString *docPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
  NSString *filename = @"xyz123.data";
  docPath = [NSString stringWithFormat:@"%@/%@", docPath, filename];
  
  NSError *error = nil;
  [data writeToFile:docPath options:0 error:&amp;error];
  </code></pre>
  
  <p>To delete files I use the following</p>
  
  <pre><code>NSFileManager *manager = [NSFileManager defaultManager];
  
  NSError *error = nil;
  
  NSString *path = @"xyz123.data";
  //NSString *path = @"Documents/xyz123.data";
  [manager path error:&amp;error];
  </code></pre>
  
  <p>But neither the first nor the second path seem to work, I always get the error "no such file or directory".</p>