警报框中的多个值xcode iphone dev

Ben*_*son 0 iphone xcode ios

我试图在一个警告框中显示多个值,但最后的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];
Run Code Online (Sandbox Code Playgroud)

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

Jer*_*026 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]; 
Run Code Online (Sandbox Code Playgroud)