views:

176

answers:

1
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
    dialog.delegate = self;
    dialog.userMessagePrompt = @"Example prompt";
    dialog.attachment = @"{\"name\":\"Facebook Connect for iPhone\","
        "\"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];

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

A: 

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

dialog.attachment = [NSString stringWithFormat:
                     @"http://img40.yfrog.com/img40/5914/%@.jpg", mystring];
Vladimir
no , it doesn't work . there's no error but it will send "http://img40.yfrog.com/img40/5914/%@.jpg" exactly .
Naeim
Are you sure you're using exactly the same code? NSString *mystring = @"lala";NSLog([NSString stringWithFormat:@"http://img40.yfrog.com/img40/5914/%@.jpg", mystring]); - this code logs correct string
Vladimir