iphone 提示(弹出)框的使用

来源:互联网 发布:arp mac绑定 编辑:程序博客网 时间:2024/05/06 02:55


UIAlertView *alertView = [[UIAlertViewalloc] initWithTitle:nilmessage:@"此用户不存在"delegate:selfcancelButtonTitle:@"关闭"otherButtonTitles:nil];

[alertView setTag: 10000];

[alertView show];

[alertView release];




//点击关闭的时候响应的函数

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {

    if ([alertView tag] == 10000) {    // it's the Error alert

        if (buttonIndex == 0) {     // and they clicked OK.

           

        }

    }

}


原创粉丝点击