私はこの文字列を持っています
NSString *jsonString = @"http://www.soccerway.com/a/block_home_matches?block_id=block_home_matches_14&callback_params=%7B%22date%22%3A%222012-07-31%22%2C%22display%22%3A%22all%22%7D&action=showMatches¶ms=%7B%22competition_id%22%3A721%7D";
NSLog(@"%@",jsonString);
the output is
http://www.soccerway.com/a/block_home_matches?block_id=block_home_matches_14&callback_params=%7B%22date%22%3A%222012-07-31%22%2C%22display%22%3A%22all%22%7D&action=showMatches¶ms=%7B%22competition_id%22%3A721%7D
私が使うとき
NSString *linkId = @"448";//not a constant value only for example
NSString *jsonString = [NSString stringWithFormat:@"http://www.soccerway.com/a/block_home_matches?block_id=block_home_matches_14&callback_params=%7B%22date%22%3A%222012-07-31%22%2C%22display%22%3A%22all%22%7D&action=showMatches¶ms=%7B%22competition_id%22%3A%@%7D",linkId];
the output is
http://www.soccerway.com/a/block_home_matches?block_id=block_home_matches_14&callback_params=7 37040ate23A222㿠 37040isplay23A0x1.21800000507cp-1027ll27D&action=showMatches¶ms=7 –ompetition_id23A(null) 0
ご覧のとおり、同じではありません。私の質問は、stringWithFormat を使用してこの結果を取得する方法です。
http://www.soccerway.com/a/block_home_matches?block_id=block_home_matches_14&callback_params=%7B%22date%22%3A%222012-07-31%22%2C%22display%22%3A%22all%22%7D&action=showMatches¶ms=%7B%22competition_id%22%3A448%7D
したがって、値 (721) は (448) に置き換えられます。