self.sign.text is suppose to return either a "+", "-", "*", or "/", which it does. However, I'm trying to have the user post one of these back into facebook via the app. All but the "+" sign will load as a string when they post it to their wall. I don't understand how to get the "+" to show.
I'm guessing that this gets lost since the "+" has a different meaning in javascript. How can I make it a string character in my NSString so that it accepts when posting. Hope this made sense.
self.sign.text is suppose to return either a "+", "-", "*", or "/", which it does. However, I'm trying to have the user post one of these back into facebook via the app. All but the "+" sign will load as a string when they post it to their wall. I don't understand how to get the "+" to show.
I'm guessing that this gets lost since the "+" has a different meaning in javascript. How can I make it a string character in my NSString so that it accepts when posting. Hope this made sense.
How are you posting your string to Facebook? Is it sending it up in an HTTP URL? If so, you need to escape characters like "+", "-", or "/". I'm not sure about "*".
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.userMessagePrompt = @"Example prompt";
dialog.attachment = @"{\"name\":\"1/2 + 1/2 = 1 or 1/1\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}";
// replace this with a friend's UID
// dialog.targetId = @"999999";
[dialog show];
The equation i have there has a + sign in it, and when I try posting it to facebook, it doesn't show. Any other sign I have no problem with. I even tried using the \ to see if it would let it thru. I'm still a beginner, so I'm trying to understand the code you just sent me. I'm so thankful for your response. Based on the code above, do you think there is an easier way to do it?
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.userMessagePrompt = @"Example prompt";
dialog.attachment = @"{\"name\":\"1/2 + 1/2 = 1 or 1/1\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\",\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}";
// replace this with a friend's UID
// dialog.targetId = @"999999";
[dialog show];
The equation i have there has a + sign in it, and when I try posting it to facebook, it doesn't show. Any other sign I have no problem with. I even tried using the \ to see if it would let it thru. I'm still a beginner, so I'm trying to understand the code you just sent me. I'm so thankful for your response. Based on the code above, do you think there is an easier way to do it?
Since you are sending your equation to Facebook embedded in an HTTP URL, characters that are used as delimiters in a URL (Like "+/?=&") may get mis-interpreted as part of the "punctuation" of the URL "sentence" rather than part of the content you are putting inside the URL. The convention for handling this to "escape" the characters that cause problems. That means converting them to the form "%xx", where xx is their ASCII value, in hexadecimal. The code I posted will find characters in a block of text and convert the characters defined at the beginning, plus some others, into their escaped form.
If you do a google search for "ASII table" you'll find this ASCII table. (link) That shows that the hex value of a plus sign is 2B. So first, just try putting your plus signs into your equation manually as "%2B".
It looks like the equation you are sending is inside quotes, so I'm a little puzzled as to why it would need to be escaped, but I would try it anyway.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Thanks Ducan. Still a no go though. When I try that, it eliminates the % and the B and just puts out the 2. So this is what you see, "1/2 2 1/2 = 1 or 1/1. Didn't think it would be this hard to get the + sign to work.
Let me correct myself, it work for twitter but not Facebook. It's so odd, what could the facebook code have that is not working. Thanks again for yor help.
Last edited by Jrman52; 07-11-2010 at 01:10 PM.
Reason: Part of the code worked
...When I try that, it eliminates the % and the B and just puts out the 2. So this is what you see, "1/2 2 1/2 = 1 or 1/1. Didn't think it would be this hard to get the + sign to work...
Are you passing the string "%2B" as any part of a string formatter? If so, the receiving formatting function will think it's a format specification. If this is the case, you need to make a change to let the function know what this "%2B" really is by "escaping" the "%" that you want to be a literal "%" in the output. This is done by doubling up the "%" character, like this: "%%2B".
Awesome, that worked! Thanks to both of you for all your help. I'm still learning alot of this stuff so it hard to find answers sometimes for questions like this. This is extremely appreciated.
One more question. How long does it take a developer to create a game? Can it be done by one person? Examle, Doodler (the current game in the top 5 in the app store). I can do my own art for a game I'm thinking of creating, just wondering if it can be done by me alone in a timely manner. Thanks in advance guy.