title: how to share image on Facebook in iphone
body: <p>I'm facing a problem in my code. I'm using this code:</p>
  
  <pre><code>//create a UIImage (you could use the picture album or camera too)
  
  NSData *imageData = UIImageJPEGRepresentation(imgView.image, 8.0);
  UIImage *picture = [UIImage imageWithData:imageData];
  
  //create a FbGraphFile object insance and set the picture we wish to publish on it
  FbGraphFile *graph_file = [[FbGraphFile alloc] initWithImage:picture];
  
  //finally, set the FbGraphFileobject onto our variables dictionary....
  [variables setObject:graph_file forKey:@"file"];    
  [variables setObject:@"i'm testing my iPhone App" forKey:@"message"];
  
  //the fbGraph object is smart enough to recognize the binary image data inside the FbGraphFile
  //object and treat that is such.....
  FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"117795728310/photos" withPostVars:variables];
  NSLog(@"postPictureButtonPressed:  %@", fb_graph_response.htmlResponse);    
  NSLog(@"Now log into Facebook and look at your profile &amp; photo albums...");
  </code></pre>
  
  <p>In this code, I get the <code>EXC_BAD_ACCESS</code> error message, but the image is posted on Facebook.</p>
  
  <p>How can I solve this problem?</p>