title: Where to store a created PDF File?
body: <p>Got the following error:</p>
  
  <pre><code>CGDataConsumerCreateWithFilename: failed to open `/name' for writing: Permission denied.
  </code></pre>
  
  <p>With this code (not mine):</p>
  
  <pre><code>- (void)createPDFWithName
  {
  //NSURL * newFilePath = [[NSURL alloc] initFileURLWithPath:name];
  NSString * newFilePath = @"name";
  
  CGRect page = CGRectMake(0, 0, 300, 300);
  
  NSDictionary * metaData = nil;
  
  if (!UIGraphicsBeginPDFContextToFile(newFilePath, page, metaData )) {
      NSLog(@"error creating PDF context");
      return;
  }
  
  UIGraphicsBeginPDFPage();
  [self.tableView.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIGraphicsEndPDFContext();
  }
  </code></pre>
  
  <p>So: Where should I store this PDF-File? I tried the <code>NSBundle MainBundle</code> thing and it did not work either.</p>
  
  <p>Thank you!</p>