iOS错误UIAlertController can only have one action with a style of UIAlertActionStyleCancel

错误提示:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIAlertController can only have one action with a style of UIAlertActionStyleCancel'

错误原因:

同一个UIAlertController里使用了两个UIAlertActionStyleCancel类型的UIAlertAction,取消按钮只能有一个!和很多代码错误一样,这个错误常常是因为直接复制导致的,所以建议同学能手打代码尽量手打,不要copy paste.



此问题SEO其他关键词入口:(同学们不用管这个,这个是方便其他碰到此问题的人用别的提问方式也能搜索到此答案,解决他们的提问效率)

Xcode报错UIAlertController can only have one action with a style of UIAlertActionStyleCancel

iOS开发UIAlertController can only have one action with a style of UIAlertActionStyleCancel

UIAlertController问题崩溃UIAlertActionStyleCancel

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    网事_79a3阅读 12,398评论 3 20
  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,486评论 0 10
  • 早点吃了块儿稻香村的自来红,有点儿腻!想起了我的绿茶最爱,也是我的私房绿茶三兄妹中的大哥,“金石冽”---明前...
    耕而陶_茶阅读 960评论 2 4
  • 与C语言类似,Go程序也是从main函数开始运行,但是这个main函数必须定义在main package中。(Go...
    louyang阅读 332评论 0 0
  • 看网页内容时注意看注释和提示等,先浏览faq一下,避免不必要的时间浪费,很关键啊,时间很值钱啊
    HenryTien阅读 223评论 0 0