iphone - 在 Facebook 墙上添加照片

标签 iphone objective-c ios4

- (void)postToWall {
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];

dialog.userMessagePrompt = [NSString stringWithFormat: subjectTitle]; //subjectTitle works here but not as name where i need it.

NSString *src = @"http://www.sample.com/image.png";
NSString *name = storyLink;  //<---------------------------------works with storyLink but not subjectTitle. I need subjectTitle to work here
NSString *href = storyLink;

NSString *attachment = [NSString stringWithFormat:@"{\"name\":\"%@\",\"media\":[{\"type\":\"image\", \"src\":\"%@\", \"href\":\"%@\"}]}", name, src, href];
dialog.attachment = attachment;
[dialog show]; 
}
<小时/>

我想从照片库添加图像 http://www.sample.com/image.png到 Facebook 墙。

任何人都可以帮助我......

提前致谢......

最佳答案

您可以使用 UIImagePickerController 及其委托(delegate)方法访问 iPhoto 图库项目的 URL。

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

当用户选择照片时,URL 将位于字典中的 UIImagePickerControllerMediaURL

键下

关于iphone - 在 Facebook 墙上添加照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3793970/

相关文章:

iphone - 多个服务器上的单个 SSL 证书将推送通知发送到同一应用程序

ios - 使用 UIAccelerometer 创建关卡应用

iphone - 设备断开连接后在 iphone 上测试时出现奇怪错误

objective-c - Core Data 对相关对象的 NSSet 进行排序时出现问题

iphone - 在 iPhone 应用程序中加载文本数据

iphone - UITextField resignFirstResponder 不工作?

ios - 将带有范围按钮的 UISearchBar 作为 subview 添加到 UIView

ios - UIView中复杂的布局,可对其内容进行动画处理

iphone - 在单个 UIViewController 中有多个 UIView 的障碍

ios - Person 没有可见性 @interface