将照片发布到Facebook

| 我正在努力寻找一些示例代码,以便在Facebook上发布。下面是我发现的代码。但是,我可以知道如何修改它以便我发布图片而不是文字吗?
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];
我尝试发布的图像也是重叠图像。这意味着它上没有文件名。声明为imageall的属性是下面的代码。
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;
非常感谢。     
已邀请:
        干得好
- (void)uploadPhoto:(id)target {

//Just for demonstration.
    NSString *path = @\"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg\";
    NSURL    *url  = [NSURL URLWithString:path];
    NSData   *data = [NSData dataWithContentsOfURL:url];
    UIImage  *img  = [[UIImage alloc] initWithData:data];
    NSDictionary *params = nil;
    [[FBRequest requestWithDelegate:self] call:@\"facebook.photos.upload\" params:params dataParam:(NSData*)img];

}
    
        有一个很好的框架作品称为“ AddThis”,可以共享图像,与Facebook的链接,Twitter等(超过100个社交网站)。 在AddThis上查看详细信息 您可以登录/注册此站点,然后转到AddThis for iOS 本指南将帮助您使用iOS SDK快速启动并运行。查看完整的文档以获取所有详细信息。 检查演示应用程序,该应用程序已嵌入下载的zip文件。 我向您保证,这是一个很好的框架。 我已经成功实现了。问我是否有任何疑问。快乐的编码。     

要回复问题请先登录注册