2010-09-25 73 views
2
- (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]; 
} 

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

任何人都可以提供我帮....

在此先感谢......

+0

的可能重复[文件的过程使用Facebook Connect为iPhone上传照片](http://stackoverflow.com/questions/750328/documented-process-for-using-facebook-connect-for-the-iphone -to-上载照片) – 2010-09-25 16:52:58

回答

1

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

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

当用户选择一个照片的URL将在字典下的关键UIImagePickerControllerMediaURL

+0

你好字典中的信息,关键UIImagePickerControllerMediaURL值为NULL。我在这里错过了什么吗? – 2010-09-27 06:21:14

+0

嗨,你有推高了挑选器界面,并从中选择了一个形象呢?你已经设置了选取控制器的代表? – 2010-09-27 21:28:02

+0

现在感谢它运作良好。 – 2010-11-12 05:44:16