使用多行消息发布到Facebook而不是简短的1行

时间:2012-04-24 21:46:40

标签: iphone facebook facebook-graph-api

我可以使用下图所示的代码发布到我的Facebook墙上,但是,“@message”值中没有兑现(换行符)回车符。请参阅下面的xcode中的错误。当我在行的末尾使用反斜杠'\'来转义换行符时,会发布帖子,但结果是不可读的。

如何为Facebook帖子发布多行内容?

更好的是,我的实际原创内容中包含html标记,例如粗体等等...有没有办法用任何更丰富的文字发布到Facebook?

非常感谢。

菲尔

见图片:https://skitch.com/aibkwik/8iuxt/fb4.xcodeproj-fb-viewcontroller.m

 NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"removed for privacy", @"app_id",
                               @"http://itunes.apple.com/us/app/golf-whiz/removed?ls=1&mt=8", @"link",
                               @"https://img.skitch.com/20120424-mauaru649ed4i4igqc8mtth6bh.png", @"picture",
                                @"Golf Whiz", @"name",
                                @"Check this out!", @"caption",
                                @"Summary Information\nSouth Riding GC\nShots fired: 13\nFarts cut: 10", @"description",nil];

  [facebook dialog:@"feed" andParams:params andDelegate:self];
  

在这里输入代码

1 个答案:

答案 0 :(得分:0)

Xcode中的NSString只能是一行。要表示换行符,您应该使用\n。您要查找的信息是:

@"Summary Information\nSouth Riding GC\nShots fired: 13\nFarts cut: 10";

其他人遇到了这个问题,似乎the second answerer可能会找到解决方案。