0
我有一個文本框,並按Ctrl並單擊到.h,並創建了一個插座並將其稱爲usernameTextField。所以我甚至沒有輸出這個屬性 - xcode是爲我做的。以下是全文:我在xcode中有一個文本框,並且每當我嘗試將其連接到屬性時,該應用程序都不會生成
@property (weak, nonatomic) IBOutlet UITextField *usernameTextField;
當我嘗試運行程序,它給了我這個錯誤 -
Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<drawKitViewController 0x12fd0aff0> setValue:forUndefinedKey:]: this class is
not key value coding-compliant for the key usernameTextField.'
那我做錯了嗎?
您是否已將此視圖中的類從UIView更改爲您自己的類名? – sha
這已連接兩次? – JSA986
[此類不是密鑰的關鍵值編碼兼容]的可能重複(http://stackoverflow.com/questions/3088059/this-class-is-not-key-value-coding-compliant-for-the -key) –