我想要獲得電影標題的亞馬遜搜索,但是在使用該網址時遇到問題。電影名稱會插入到帶有'%@'的鏈接中,但多餘的'%'會導致問題。任何幫助,將不勝感激。ios網址問題
錯誤:
More '%' conversions than data arguments
Format specifies type 'int' but the argument has type 'NSString *'
這裏是我的代碼:
- (void)jumpToAmazon:(id)sender {
// create the string that points to the correct Amazon page for the game name
NSString *amazonPageString = [NSString stringWithFormat:@"http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Dmovies-tv&field-keywords=%@&sprefix=friend%2Cmovies-tv&rh=i%3Amovies-tv%2Ck%3A%@", self.movie.name, self.movie.name];
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:amazonPageString]])
{
// there was an error trying to open the URL. for the moment we'll simply ignore it.
}
}