Tag: uialertsheet

UIAlertController中的checkbox与目标c中的操作表

我想添加checkbox,即UIButton和Uilabel在UIAlertAction中的一个选项,只有在UIAlertController中的另一个UIAlertAction中的button。 请帮助和build议如何实现它。 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"My Alert" message:@"This is an action sheet." preferredStyle:UIAlertControllerStyleActionSheet]; // 1 UIAlertAction *firstAction = [UIAlertAction actionWithTitle:@"one" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { NSLog(@"You pressed button one"); }]; // 2 UIAlertAction *secondAction = [UIAlertAction actionWithTitle:@"two" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { NSLog(@"You pressed button two"); }]; // 3 [alert addAction:firstAction]; // 4 [alert […]

UIAlertController崩溃(iPad)

我正在使用Xcode 6开发iOS应用程序。 当我使用UIAlertController ,它可以在iPhone 6模拟器上运行,但在iPad模拟器上崩溃。 我的问题,同时点击“分享”,然后它可能会坠毁。 我怎么能解决它? 这是我的代码: override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject] { var shareAction = UITableViewRowAction(style: UITableViewRowActionStyle.Default, title: "Share", handler: { (action:UITableViewRowAction!, indexPath:NSIndexPath!) -> Void in let shareMenu = UIAlertController(title: nil, message: "Share using", preferredStyle: .ActionSheet) let twitterAction = UIAlertAction(title: "Twitter", style: UIAlertActionStyle.Default, handler: nil) let facebookAction = UIAlertAction(title: […]