IOS 基本的用户警告实例

作者:朱克锋

邮箱:[email protected]

转载请注明出处:http://blog.csdn.net/linux_zkf

实例截图

IOS 基本的用户警告实例_第1张图片


@interface TestViewController : UIViewController <UIAlertViewDelegate>

@end


@implementation TestViewController


- (void) alertView:(UIAlertView *) alertView clickedButtonAtIndex: (int) index

{

printf("User selected button %d\n", index);

[alertView release];

}


- (void) showAlert: (NSString *) message

{

    UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"ZHUKEFENG" message:message delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"ZHU", @"KE", @"FENG", nil];

av.tag = MAIN_ALERT;

    [av show];

}


- (void) action: (id) sender

{

[self showAlert:@"ZHUKEFENG Test Alert"];

}

你可能感兴趣的:(IOS 基本的用户警告实例)