iOS API - Help!

Discussion in 'iOS Programming' started by freemusic86, Apr 30, 2013.

  1. freemusic86, Apr 30, 2013
    Last edited: Jun 28, 2013

    freemusic86 macrumors newbie

    Feb 4, 2012

    This, I am sure is really simple but:

    I have done some looking around at some other post on here but none of them seem to work either. So, my question is using the Twitter API built into iOS, how do I include the text from a label into the initial Twitter text.

    I have:

    [tweetSheet setInitialText:@"I have just generated the following numbers from The Lottery App: %@", label1.text];

    Could anyone help? - Thanks in advance

    Free iPhone
  2. truehybridx, Apr 30, 2013
    Last edited: Apr 30, 2013

    truehybridx macrumors member

    Dec 6, 2010
    You might need to familiarize yourself with how to use NSString..

    You've halfway got it but you are missing something.

    setInitialText, takes an NSString as a single argument.

    You are trying give it an NSString and another NSString, so you need those 2 strings put into 1 string first, then give it to setInitialText

    There's a method for that, that takes numerous strings, and returns a single string object :)

    Have fun :D
  3. freemusic86 thread starter macrumors newbie

    Feb 4, 2012
    Thanks for pointing me in the right direction :D

Share This Page