作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个基本的登录页面,它采用两个值(用户名和密码),这些详细信息被传递到我的服务器,我在服务器上使用 PHP 解析结果并返回 JSON 数组。
一切正常;我可以正确登录,错误登录时会出现正确的错误警报等。但是,每当我尝试登录应用程序时,键盘未最小化:
libc++abi.dylib: terminating with uncaught exception of type NSException
我希望有人能知道这是为什么?我的整个错误线程如下:
libsystem_kernel.dylib`__pthread_kill:
0x18bb6700c <+0>: movz x16, #0x148
0x18bb67010 <+4>: svc #0x80
->0x18bb67014 <+8>: b.lo 0x18bb6702c ; <+32>
0x18bb67018 <+12>: stp x29, x30, [sp, #-16]!
0x18bb6701c <+16>: mov x29, sp
0x18bb67020 <+20>: bl 0x18bb4a7d0 ; cerror_nocancel
0x18bb67024 <+24>: mov sp, x29
0x18bb67028 <+28>: ldp x29, x30, [sp], #16
0x18bb6702c <+32>: ret
最佳答案
异常是告诉您不要在后台线程上执行 UI 操作。您需要将任何涉及 UI 的代码封装到主线程的调度中:
DispatchQueue.main.async {
// set up and present alert
}
通常,每当您使用以 UI
开头或名称中包含 View
的类时,您都需要位于主线程上。
关于swift - 当键盘存在时未捕获 NSException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42217681/
在我们的数据库表上,我们使用两个唯一的非聚集索引来创建跨四个字段的唯一约束。我们使用两个,因为其中一个字段 ZipCode 是一个可为空的字段。如果表中存在一条包含 ZipCode 的 null 条目
我刚刚开始学习 Rails 3 教程,以便对框架有一点熟悉,但我在生成 schema.rb 时遇到了问题。我的操作系统是 Windows 7 x64、Ruby 1.9.2、MySQL2 gem 0.2
我是一名优秀的程序员,十分优秀!