2013-06-20 99 views
-3

我編寫了一些虛擬應用程序,以瞭解iOS這一個這樣的應用程序是一個TODO列表。單擊按鈕添加新任務時出現以下錯誤。終止應用程序,由於未捕獲的異常'NSUnknownKeyException

2013-06-20 09:56:00.763 SnapTask[2322:11303] Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SLAddTaskViewController 0x917fb90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key email.' 
First throw call stack: 
(0x1c92012 0x10cfe7e 0x1d1afb1 0xb7c711 0xafdec8 0xafd9b7 0xb28428 0x2340cc 0x10e3663 0x1c8d45a 0x232bcf 0xf7e37 0xf8418 0x24634e 0xf8648 0xf8882 0xf8b2a 0x10fef5 0x10ffdb 0x110286 0x110381 0x110eab 0x110fc9 0x10e225 0x126082 0x12613a 0x3050e6 0xd6cba 0xd7ae8 0x304f44 0x3044eb 0x1014f3 0x101777 0x1017b7 0x46cfe2 0x45ead9 0x45eb54 0x10e3705 0x1a920 0x256b24 0x10e3705 0x1a920 0x1a8b8 0xdb671 0xdbbcf 0xdad38 0x4a33f 0x4a552 0x283aa 0x19cf8 0x1beddf9 0x1bedad0 0x1c07bf5 0x1c07962 0x1c38bb6 0x1c37f44 0x1c37e1b 0x1bec7e3 0x1bec668 0x1765c 0x24ad 0x23d5) 
libc++abi.dylib: terminate called throwing an exception 
(lldb) 

我不知道添加任務

這是我AddTaskViewController

#import <UIKit/UIKit.h> 

@class TaskListViewController; 

@interface AddTaskViewController : UITableViewController 

-(IBAction)cancelButtonPressed:(id)sender; 
-(IBAction)doneButtonPressed:(id)sender; 

@property (nonatomic,strong) IBOutlet UITextView *nameField; 
@property (nonatomic,strong) IBOutlet UITextView *emailField; 
@property (nonatomic,strong) IBOutlet UITextView *homeField; 
@property (nonatomic,strong) IBOutlet UITextView *cellField; 
@property (nonatomic,strong) IBOutlet UITextView *addressField; 
@property (nonatomic,strong) IBOutlet UITextView *notesField; 
@property (nonatomic,strong) IBOutlet UITextView *dateField; 
@property (nonatomic,strong) IBOutlet TaskListViewController * taskListViewController; 

@end 

謝謝我很迷茫的時候哪裏甚至開始,該列表存儲名字的電子郵件和等: (

+0

你重構了你的代碼嗎?是否有任何電子郵件名稱的組件?檢查您的連接是否有任何無效值。 – Anupdas

+1

在我看來,你只是將錯誤信息轉儲到SO中,而沒有閱讀並嘗試在觸發之前解決它。這並不酷。 – 2013-06-20 14:10:27

+0

發佈此類問題前,請查看現有重複問題的長長列表。 – rmaddy

回答

1

我想你已經將你的IBOutlet名稱的電子郵件地址改爲emailField.So你需要在你的xib中重新連接你的IBOutlet。所以請點擊File's Owners contro l +在當時左鍵單擊,您將看到連接上的顏色不同,請重新連接IBOutlet。

我希望這會有所幫助。

+0

我該怎麼做? –

+0

去你的IB,然後檢查你的所有IBOutlets –

0

嘗試重新連接該類中的所有UIElement

相關問題