title: iPhone - sending an image with Sharekit to Facebook
body: <p>I'm using ShareKit to send a comment and an image to facebook. Everything's working fine except that if no user image exists (in the coredata/sqlite db) I would like to send a default image instead. Here's my code, with <code>example.png</code> being the default image and <code>initWithData:entity.userImage</code> being the image the user added with their iPhone. Maybe there's something wrong with my if else statement.</p>
  
  <pre><code>-(IBAction) fbButton {
  
      SHKItem *item;
      NSURL *url = [NSURL URLWithString:@"http://itunes.apple.com/ae/artist/XXX"];
      item = [SHKItem URL:url title:[NSString stringWithFormat:@"Take a look at %@", entity.name]];
      [SHKFacebook shareItem:item];
  
  
      if (entity.image = nil) {
  
              UIImage *image = [UIImage imageNamed:@"example.png"];
              SHKItem *item2 = [SHKItem image:image title:nil];
              [SHKFacebook shareItem:item2];
  
      } else {
  
  
              UIImage *image = [[[UIImage alloc] initWithData:entity.userImage] autorelease];
  
  
              SHKItem *item2 = [SHKItem image:image title:nil];
              [SHKFacebook shareItem:item2];
  
      }       
  
  
      [SHK flushOfflineQueue];        
  </code></pre>
  
  <p>}</p>
  
  <p>The problem is that if there is no image in the database Sharekit gives a UIAlert saying that a file must be present in the upload. I was trying to get around this by always providing a default image in case the record in the database doesn't have one.</p>
  
  <p>as always, thanks for any help</p>