UIAlertController使用的一个坑
2016-06-02 20:50
387 查看
把下面这句话放在block内部”不然会死循环,导致警告控制器不能销毁"
UITextField *textField = alertA.textFields.firstObject;
UIAlertAction
*ok = [UIAlertAction
actionWithTitle:@"确定"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction
*
_Nonnull
action) {
hero.name
= textField.text;
[self.tableView
reloadData];
// [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
// [alertA dismissViewControllerAnimated:NO completion:nil];
}];
UITextField *textField = alertA.textFields.firstObject;
UIAlertAction
*ok = [UIAlertAction
actionWithTitle:@"确定"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction
*
_Nonnull
action) {
hero.name
= textField.text;
[self.tableView
reloadData];
// [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
// [alertA dismissViewControllerAnimated:NO completion:nil];
}];
相关文章推荐
- 关于嵌入式编程中的uint8_t、uint16_t......
- Request和Response
- UI(base)-4
- UIView+Extension"推出视图"
- 利用UIGraphics绘制一个会走的时钟
- 解决Guidline muste specify type方案
- easyUI中文乱码
- leetcode 300. Longest Increasing Subsequence-最长子序列|动态规划
- 触摸UITextView找到该触摸点的文字
- Qt之操作数据库(SQLite) [此博文包含图片] (2013-12-09 16:58:05) 转载 ▼ 标签: qt sqlite qsqldatabase qsqlquery qsqlerro
- NGUI制作流光效果
- NGUI组件整理总结
- UIView与CALayer
- Build Your Own Lisp chapter4的小错误 error: editline/history.h: No such file or directory的解决
- iOS UITableView+FDTemplateLayoutCell 配合AutoLayout分分钟教你实现动态高度自适应
- 【UGUI实战】游戏右上角CoinBar的自动调整
- UIView Class Reference
- Android UI
- UITableViewCellAccessoryType
- Scala Java Error: value filter is not a member of *