iOS 8.3 UIAlertController crashes when trying to add a textfield

后端 未结 12 1556
暗喜
暗喜 2020-12-30 03:44

I have an iPad app. I am creating an UIAlertController and adding a textfield. It crashes. It only crashes when I add a textfield.

let alert = UIAlertContr         


        
12条回答
  •  醉梦人生
    2020-12-30 04:37

    As @Dex mentioned, I fixed this by modifying my controller's view AFTER adding the text field. I was modifying the view's tint color.

    controller.view.tintColor = ...some color...
    

    Moving this to "after" adding the text field fixed it for me. Accepted answer and other suggestions led to other bugs for me. Sorry, I don't have the rep to post a comment yet on @Dex's answer.

提交回复
热议问题