title: Posting a photo to Facebook
body: <p>I am trying very hard to find some sample codes for posting on facebook. Below is the code i found. However, may i know how to modify it in order to me to post a image instead of text ?</p>
  
  <pre><code>FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
  dialog.userMessagePrompt = @"Enter your message:";
  dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"%@ got straight A's!\",\"href\":\"http://www.raywenderlich.com/\",\"caption\":\"%@ must have gotten real lucky this time!\",\"description\":\"\",\"media\":[{\"type\":\"image\",\"src\":\"http://www.raywenderlich.com/wp-content/themes/raywenderlich/images/logo.png\",\"href\":\"http://www.raywenderlich.com/\"}]}", _facebookName, _facebookName];
  dialog.actionLinks = @"[{\"text\":\"Get MyGrades!\",\"href\":\"http://www.raywenderlich.com/\"}]";
  [dialog show];
  </code></pre>
  
  <p>Also the image i am trying to post is a overlapping image. which means it has no file name on it. It is property declared named imageall as the code below. </p>
  
  <pre><code>CGRect subviewFrame3 = [self.comment.superview convertRect:self.comment.frame toView:self.imageall]; [self.imageall addSubview:self.comment]; self.comment.frame = subviewFrame3;
  
  UIGraphicsBeginImageContext(self.imageall.frame.size);
  [self.imageall.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsGetCurrentContext();
  
  self.outputView.image = image;
  </code></pre>
  
  <p>Many thanks.</p>