0
votes

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.

1
you are using that example right?? that example is working properly. Now compare your project with that example and findout whats wrong with your code :) - Jean-Luc Godard
ya i am using that sdk and am able to connect to facebook and able to post message but i can't display tableview selected message on wall default. - sirisha
what is this term doing in your example ?? twittermessage - Jean-Luc Godard
declare NSString as twittermessage because in my app i displayed all messages on tableview access throgh fromdatabase using web services and provide share message in twitter & facebook suppose we select first,second, or other message on tableview when select that message displayed a popup message ie facebook,twitter and report abuse options i want to share that message in twitteror facebook at that time i daclare twittermessage as nsstring select message assign to that string and attach to twitter and facebook urls. - sirisha
Hello Sirisha, I hope my ans is true for your quest, then you can accept my ans as a true ans by clicking on checkbox of my ans. Thanks in adv. - Chetan Bhalara

1 Answers

1
votes

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