UIAlertView用法

//显示对话框

UIAlertView *alert = [[UIAlertView alloc] initWithTitle"@"标题" message:nil delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定",nil];

//输入框样式

alert.alertViewStyle = UIAlertViewStylePlainTextInput;

//设置名称到文本框

UITextField *textField = [alert textFieldAtIndex:0];

textField.text = name;

[alert show];

 //点击了AlertView上面的按钮时会调用

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSIneteger) buttonIndex{}

 

//重新向dataSrouce请求数据

//重新调用数据源的方法numberOfRowsInSection和cellForRowAtIndexPath

[tableview reloadData];

posted @ 2013-05-08 17:57  wangzhenxiang  阅读(162)  评论(0编辑  收藏  举报