Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
502 views
in Technique[技术] by (71.8m points)

objective c - How to post message to Facebook wall from the iPhone SDK?

I am new to iPhone. My application connects to Facebook using the iPhone SDK, and I can post a default message using

@"http://www.facebook.com/connect/prompt_feed.php/?message=Hello"

but in my application all messages display on tableview and I want to post the selected message on the wall of Facebook, store selected message in a Twitter message (variable twittermessage) and write

@"http://www.facebook.com/connect/prompt_feed.php/?message=%@",twittermessage;

But it gives the following error.

statically instance of Objective-C NSString

I used the iPhone Facebook SDk from How To Post on Facebook with your iPhone App.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

the error message you are getting is due to NSString. this is not an facebook error.

In order to post a message on facebook use the following code

[NSString stringwithFormat:@"http://www.facebook.com/connect/prompt_feed.php/?message=%@",twittermessage];

Then use this string as a reference for the URL to post a message


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...