[英]App stuck on splash screen - ending with an NSException on Xcode
每次我在模擬器中啟動應用程序時,它都會運行,但 go 沒有超過啟動/啟動屏幕,我為入職屏幕創建了 1 張幻燈片,但在我的模擬器上看不到更新,並且此錯誤不斷出現。 .
不知道我做錯了什么......
Exception NSException * "[<UIViewController 0x7f9673d08e90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key NextBtn." 0x0000600003a61020
name __NSCFConstantString * "NSUnknownKeyException" 0x00007fff801e80a0
__NSCFString __NSCFString
reason __NSCFString * "[<UIViewController 0x7f9673d08e90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key NextBtn." 0x00006000005086e0
userInfo __NSDictionaryI * 2 key/value pairs 0x0000600002146e40
[0] (null) "NSTargetObjectUserInfoKey" : (no summary)
[1] (null) "NSUnknownUserInfoKey" : "NextBtn"
reserved __NSDictionaryM * 2 key/value pairs 0x000060000342dce0
[0] (null) "callStackReturnAddresses" : 42 elements
[1] (null) "callStackSymbols" : 42 elements
打開 Storyboard 並在最后一部分(連接檢查器)的右側窗格中搜索“NextBtn”插座。
你會看到那里有一個小感嘆號。
通過刪除或重新將插座連接到代碼來修復它。
每次看到
this class is not key value coding-compliant for the key
這意味着 Storyboard/XIB 中的插座連接斷開。 只需查找感嘆號圖標並將其刪除。
當您手動復制粘貼視圖、更改/刪除代碼中的類或重命名代碼中的屬性名稱(但您忘記在界面構建器中重新創建出口)而不是通過重構選項時,很容易發生這種情況。 Storyboards/XIBs 沒有那么智能,基本上你需要自己保持與代碼的同步。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.