Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在facebook墙上添加照片 -(无效)postToWall{ FBStreamDialog*dialog=[[[FBStreamDialog alloc]init]autorelease]; dialog.userMessagePrompt=[NSString stringWithFormat:subjectTitle];//subjectTitle在这里可用,但在我需要它的地方不能用作名称。 NSString*src=@”http://www.sample.com/image.png"; NSString*name=storyLink;//_Iphone_Objective C_Ios4 - Fatal编程技术网

Iphone 在facebook墙上添加照片 -(无效)postToWall{ FBStreamDialog*dialog=[[[FBStreamDialog alloc]init]autorelease]; dialog.userMessagePrompt=[NSString stringWithFormat:subjectTitle];//subjectTitle在这里可用,但在我需要它的地方不能用作名称。 NSString*src=@”http://www.sample.com/image.png"; NSString*name=storyLink;//

Iphone 在facebook墙上添加照片 -(无效)postToWall{ FBStreamDialog*dialog=[[[FBStreamDialog alloc]init]autorelease]; dialog.userMessagePrompt=[NSString stringWithFormat:subjectTitle];//subjectTitle在这里可用,但在我需要它的地方不能用作名称。 NSString*src=@”http://www.sample.com/image.png"; NSString*name=storyLink;//,iphone,objective-c,ios4,Iphone,Objective C,Ios4,您可以使用UIImagePickerController及其委托方法访问iPhoto库项的URL - (void)postToWall { FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease]; dialog.userMessagePrompt = [NSString stringWithFormat: subjectTitle]; //subjectTitle works here but not as na

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

- (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]; 
}
当用户选择照片时,URL将在字典中的键下
UIImagePickerControllerMediaURL

这可能会对您有所帮助


另外,Sharekit是一个很好的框架,可以为你的iPhone应用程序添加社交功能。我认为它有共享图像的功能。你可以在以下位置查看它。

字典信息中Hello的可能重复项,UIImagePickerControllerMediaURL键的值为空。我在这里遗漏了什么吗?嗨,你推过picker界面并选择了im吗从它开始老化?您已经设置了选择器控制器的委托?您能让它工作吗?我尝试使用NSTemporaryDirectory()中图片的URL,它没有显示…不确定这是否是同一个问题,我在上发布了此消息,试图使其与所述的photo picker一起工作,但无法使其工作…您使用的是facebook connect还是新的graph API?
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info