警报框中的多个值xcode iphone dev

时间:2012-06-19 13:52:14

标签: iphone ios xcode

我正在尝试在警告框中显示多个值,但是dos dos的最后一个似乎显示, 这是我已经有的代码,

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You Lose" message:[NSString stringWithFormat: @"Unlucky you only made it to       Level : %d" ,fred,@" and scored %i",score ] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];

有人可以建议一个更好的方式来表现吗?

1 个答案:

答案 0 :(得分:5)

试试这个:

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You Lose" message:[NSString stringWithFormat: @"Unlucky you only made it to Level : %d  and scored %i",fred,score ] delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];