xCode -错误/崩溃时解散键盘



我有一个问题与我的xCode项目,由于未知的原因,它开始崩溃时,关闭或隐藏键盘一旦你完成打字。在新的xCode 8更新之前没有发生这种情况,我希望有人能在这里帮助我。

错误码

2016-10-07 10:30:13.658061 Stormpath Notes[353:85164] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2016-10-07 10:30:13.659786 Stormpath Notes[353:85164] [MC] Reading from public effective user settings.
2016-10-07 10:30:15.840368 Stormpath Notes[353:85188] 0x17014a030 Copy matching assets reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014a030> { count = 1, transaction: 0, voucher = 0x0, contents =
    "Result" => <int64: 0x17003e360>: 29
}
2016-10-07 10:30:15.848842 Stormpath Notes[353:85188] 0x17014c8c0 Daemon configuration query reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014c8c0> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Dictionary" => <dictionary: 0x17014c550> { count = 1, transaction: 0, voucher = 0x0, contents =
        "ServerURL" => <dictionary: 0x17014cc30> { count = 3, transaction: 0, voucher = 0x0, contents =
            "com.apple.CFURL.magic" => <uuid: 0x17024d020> C3853DCC-9776-4114-B6C1-FD9F51944A6D
            "com.apple.CFURL.string" => <string: 0x17024fab0> { length = 30, contents = "https://mesu.apple.com/assets/" }
            "com.apple.CFURL.base" => <null: 0x1ada4fe80>: null-object
        }
    }
    "Result" => <int64: 0x17003db60>: 0
}
2016-10-07 10:30:15.849389 Stormpath Notes[353:85188] [MobileAssetError:29] Unable to copy asset information from https://mesu.apple.com/assets/ for asset type com.apple.MobileAsset.TextInput.SpellChecker
2016-10-07 10:30:19.636313 Stormpath Notes[353:85188] 0x17014c600 Copy matching assets reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014c600> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Assets" => <data: 0x170073540>: { length = 4379 bytes, contents = 0x62706c6973743030d4000100020003000400050006019001... }
    "Result" => <int64: 0x170037ba0>: 0
}
2016-10-07 10:30:19.648546 Stormpath Notes[353:85188] 0x17414abe0 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17414abe0> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x1744651c0>: { length = 302 bytes, contents = 0x62706c6973743030d40102030405061a1b58247665727369... }
    "Result" => <int64: 0x1740376c0>: 0
}
2016-10-07 10:30:19.652192 Stormpath Notes[353:85188] 0x17014c760 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17014c760> { count = 3, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x17047d340>: { length = 515 bytes, contents = 0x62706c6973743030d4010203040506232458247665727369... }
    "Result" => <int64: 0x17003e9c0>: 0
    "SandboxExtension" => <string: 0x170256620> { length = 258, contents = "c2ce16136725e2c509a70d9c78cb9c2d8098838e;00000000;00000000;0000000000000015;com.apple.assets.read;00000001;01000003;00000000002c3217;/private/var/MobileAsset/Assets/com_apple_MobileAsset_LinguisticData/12124144ce3f42648e61a6a8064d2fb9b2d42605.asset/AssetData" }
}
2016-10-07 10:30:19.655563 Stormpath Notes[353:85188] 0x17414a240 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17414a240> { count = 2, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x174465c00>: { length = 302 bytes, contents = 0x62706c6973743030d40102030405061a1b58247665727369... }
    "Result" => <int64: 0x174037460>: 0
}
2016-10-07 10:30:19.659475 Stormpath Notes[353:85188] 0x17414ad40 Copy assets attributes reply: XPC_TYPE_DICTIONARY  <dictionary: 0x17414ad40> { count = 3, transaction: 0, voucher = 0x0, contents =
    "Attributes" => <data: 0x174464c80>: { length = 515 bytes, contents = 0x62706c6973743030d4010203040506232458247665727369... }
    "Result" => <int64: 0x174026c20>: 0
    "SandboxExtension" => <string: 0x17425d5b0> { length = 258, contents = "34106c8c1a75ddc17eab9f02e36f839c9ec6d2f8;00000000;00000000;0000000000000015;com.apple.assets.read;00000001;01000003;00000000002c321a;/private/var/MobileAsset/Assets/com_apple_MobileAsset_LinguisticData/2e428a59a8c74acf82b249f73fcbbc785b892f69.asset/AssetData" }
}
2016-10-07 10:30:39.089880 Stormpath Notes[353:85164] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (_SwiftValue)'
*** First throw call stack:
(0x18f52c1c0 0x18df6455c 0x18f52c108 0x190099620 0x19009b778 0x18f529220 0x19009af04 0x1900994ec 0x19009931c 0x19009a360 0x1000ffbb4 0x100100444 0x19541a1a4 0x19579c4c8 0x1955353e4 0x195534828 0x1955285f8 0x1957a8bb4 0x195398598 0x1957a8868 0x1953a2b44 0x19539dd8c 0x19536e858 0x195b5bcb8 0x195b55720 0x18f4da278 0x18f4d9bc0 0x18f4d77c0 0x18f406048 0x190e89198 0x1953d9628 0x1953d4360 0x100107590 0x18e3e85b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

如果有人能解释一下为什么会这样,我将不胜感激。

错误是Invalid type in JSON write (_SwiftValue),这意味着它不能在JSON中序列化您的对象。当JSON不支持在对象中设置的要序列化的数据类型时,就会发生这种情况,因此序列化器失败。

查看这里的Apple文档,查看可接受的类类型

这可能会导致崩溃

2016-10-07 10:30:39.089880 Stormpath Notes[353:85164] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (_SwiftValue)'
*** First throw call stack:
(0x18f52c1c0 0x18df6455c 0x18f52c108 0x190099620 0x19009b778 0x18f529220 0x19009af04 0x1900994ec 0x19009931c 0x19009a360 0x1000ffbb4 0x100100444 0x19541a1a4 0x19579c4c8 0x1955353e4 0x195534828 0x1955285f8 0x1957a8bb4 0x195398598 0x1957a8868 0x1953a2b44 0x19539dd8c 0x19536e858 0x195b5bcb8 0x195b55720 0x18f4da278 0x18f4d9bc0 0x18f4d77c0 0x18f406048 0x190e89198 0x1953d9628 0x1953d4360 0x100107590 0x18e3e85b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

为各自的UIViewcontroller删除未引用的IBOutlets和IBAction。

Select "View > Utilities > Show Connections Inspector"

在我的情况下,这个异常解决使用上述解决方案。

希望能帮上忙。

这对我来说很好,漂亮。将对象属性更改为

textView.autocorrectionType = UITextAutocorrectionTypeNo;
textView.spellCheckingType = UITextSpellCheckingTypeNo;

点击这里

相关内容

  • 没有找到相关文章

最新更新