[IOS UIalert模版]
1.alertview创建
UIAlertView *alert; alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"题库有更新,需要更新吗?" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil]; [alert setTag:1]; [alert show];
2.回调函数
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { if ([alertView tag] == 1) { if (buttonIndex == 0) { // and they clicked OK. //更新题库 } } }
___________________________________________________
专注iOS/前端开发,广泛涉猎多种平台和技术,欢迎交流
可以在微博关注并@沈z伟