简体   繁体   中英

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 .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM