2010-07-14 2 views

답변

0

지금 UIAlertView을 어떻게 표시하고 있습니까?

double myDouble = 12.6; 
NSString *alertString = [NSString stringWithFormat:@"%g", myDouble]; 
UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:alertString 
                message:nil 
               delegate:nil 
             cancelButtonTitle:nil 
             otherButtonTitles:nil]; 
[myAlert show]; 
3

가 포맷 NSString에 값을 넣고 alertView에 그를 보내 : 다음과 같은 뭔가 작업을해야

NSString *messageString = [NSString stringWithFormat:"@number = %.2f", 42.0]; 


UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Title text" message:messageString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
[alertView show]; 
[alertView release];