2010-09-25 72 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