开发者

Is there any example code explaining how to change Facebook's API existing code to make it yours?

FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
    dialog.delegate = self;
    dialog.userMessagePrompt = @"Example prompt";
    dialog.attachment = @"{\"name\":\"Facebook Connect for iPhone\","
        "\"href\":\"http://developers.fac开发者_开发百科ebook.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];

Is there any example code explaining how to change Facebook's API existing code to make it yours?

i want to change http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg to http://img40.yfrog.com/img40/5914/%@.jpg //... , mystring


You can use NSString's +stringWithFormat method. Something like that:

dialog.attachment = [NSString stringWithFormat:
                     @"http://img40.yfrog.com/img40/5914/%@.jpg", mystring];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜