__weak typeof (alert) weekAlert=alert;
[alert addAction:[UIAlertAction actionWithTitle:@"submit" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
NSLog(@"click submit button");
NSLog(@"first textField‘s text is %@,the second textField‘s text is %@",[weekAlert.textFields.firstObject text],[weekAlert.textFields.lastObject text]);
}]];
UIAlertController循环引用问题
最新推荐文章于 2019-01-11 14:02:16 发布
本文介绍了一个使用 Swift 语言实现的 UIAlertController 示例。示例中定义了一个弱引用的 alert 方法,并通过 UIAlertAction 添加了一个具有破坏性的操作,点击该操作时会记录下两个文本字段的内容。
307

被折叠的 条评论
为什么被折叠?



