title: Saving image to Documents directory and retrieving for email attachment
body: <p>I having trouble figuring out <code>NSBundle</code> &amp; DocumentDirectory data, I have a Camera Picture "<em>imageView</em>" that I'm saving to the <code>NSDocumentDirectoy</code> and then want to retrieve it for attaching to an email,</p>
  
  <p>Here the saving code:</p>
  
  <pre><code>- (IBAction)saveImage {
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
      NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage.png"];
      UIImage *image = imageView.image; // imageView is my image from camera
      NSData *imageData = UIImagePNGRepresentation(image);
      [imageData writeToFile:savedImagePath atomically:NO];   
  }
  </code></pre>
  
  <p>Here is the new getting data code:</p>
  
  <pre><code>    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDirectory = [paths objectAtIndex:0];
      NSString *appFile = [documentsDirectory stringByAppendingPathComponent:@"savedImage.png"];
      NSData *myData = [[[NSData alloc] initWithContentsOfFile:appFile] autorelease];
      [picker addAttachmentData:myData mimeType:@"image/png" fileName:@"savedImage"];
  </code></pre>