Saturday, September 4, 2010

How to send a Variable to an UILAERTVIEW

In this example there is a variable called Score in the program. You want to display the user's Score in a UIAlertview. User the following 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];


No comments:

Post a Comment