簡體   English   中英

xCode - 關閉鍵盤時出錯/崩潰

[英]xCode - Error/Crash when dismissing keyboard

我的 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;

要了解它,請單擊此處

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM