title: objective C save file with extension and name to dictonary
body: <p>I have a browse function where I get the url of a file.</p>
  
  <p>Now I want to save the file in the supporting file dictionary so that if the file is move anywhere else it can still access it</p>
  
  <p>I have a code which saves it to the supporting files:</p>
  
  <pre><code>NSURL *mainUrl;
  mainUrl=[[NSBundle mainBundle] bundleURL];
  NSFileManager *Fm;
  [Fm copyItemAtURL:url toURL:mainUrl error:nil];
  </code></pre>
  
  <p>but I don't know what the name and the extension because the browse function allows png,jpg,jepg files</p>
  
  <p>and I would need the name to access it</p>
  
  <p>so my question would be how I can I save the file there with a name and extension of my choose </p>
  
  <p>my name would look like that:</p>
  
  <pre><code>NSString *string;
  NSInteger number;
  number=0;
  string=[NSString stringWithFormat:@"%@%li",@"img",(long)number];
  </code></pre>
  
  <p>and the extension would be jpg </p>
  
  <p>can somebody help me?</p>