我的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)
如果有人能够解释为什么会发生这种情况会非常感激。
答案 0 :(得分:1)
错误为Invalid type in JSON write (_SwiftValue)
,这意味着无法在JSON中序列化您的对象。当 JSON 不支持您要序列化的对象中设置的数据类型时会发生这种情况,因此序列化程序会失败。
查看Apple文档here,查看已接受的类。
答案 1 :(得分:0)
这可能是导致崩溃的原因
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)
答案 2 :(得分:0)
为相应的UIViewcontroller删除未引用的IBOutlets和IBAction。
Select "View > Utilities > Show Connections Inspector"
在我的情况下,使用上述解决方案解决了这个异常。
答案 3 :(得分:0)
希望它能全力以赴。
它为我制作华丽。像对象一样更改对象属性,
textView.autocorrectionType = UITextAutocorrectionTypeNo;
textView.spellCheckingType = UITextSpellCheckingTypeNo;
了解它Click here。