Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
503 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...