Facebook Connect help

Discussion in 'iOS Programming' started by uaecasher, Dec 26, 2009.

  1. uaecasher macrumors 65816

    uaecasher

    Joined:
    Jan 29, 2009
    Location:
    Stillwater, OK
    #1
    hello,

    I want to publish feed from my application, my question is how can use a varible from my app as the description content.

    So here is what I have came up with for the other pars:

    Code:
    
    FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
        dialog.delegate = self;
        dialog.userMessagePrompt = @"Example prompt";
        dialog.attachment = @"{\"name\":\"iPhone App test\",\"href\":\"http://www.mozymac.com/forums\",\"caption\":\"Caption\",\"description\":\"Description\",\"media\":[{\"type\":\"image\",\"src\":\"http://mozymac.com/forums/images/misc/logo.png\",\"href\":\"http://www.mozymac.com/forums/\"}],\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}";
        // replace this with a friend's UID
        // dialog.targetId = @"999999";
        [dialog show];
    
    
    I want to change Description to display a string from a variable, let's say "mainstring" for example.

    Thanks
     
  2. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #2
    You would have to create a stringWithFormat for the delegate.attachment. This will allow you to use variables in the message. You just use %@ for where variable text goes then at the end of the initial string comma the variable names.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State

Share This Page