Quote:
Originally Posted by rrichar
I have the following UIAlertview in my program
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Final Score"
message:@"End of test. You scrose is: ."
delegate:self
cancelButtonTitle:@"Continue"
otherButtonTitles:nil];
[alert show];
[alert release];
I have an integer called Score that I want to concatenate to the end of the sentence. Can someone tell me how ?
|
If your integer score value is called "score", just do this:
Code:
NSString* messageString = [NSString stringWithFormat: @"End of test. Your score is: %d", score];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Final Score"
message: messageString
delegate: self
cancelButtonTitle: @"Continue"
otherButtonTitles: nil
];
[alert show];
[alert release];