1
我正在進入iPhone開發的深海。我有以下頭文件。使用界面生成器設置UITextField委託並且不更新頭文件
//
// FirstProjectViewController.h
// FirstProject
//
// Created by Mohammad Azam on 6/25/10.
// Copyright HighOnCoding 2010. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FirstProjectViewController : UIViewController<UITextFieldDelegate> {
IBOutlet UITextField *number1TextField;
IBOutlet UITextField *number2TextField;
IBOutlet UILabel *resultLabel;
}
- (IBAction) add: (id) sender;
@end
我想在用戶單擊「返回」鍵時隱藏虛擬鍵盤。爲此,我的控制器實現了UITextFieldDelegate。我還去了界面構建器,並使用連接將UITextField委託連接到文件所有者。但我的頭文件從不更新。如果不更新並添加一個名爲textFieldShouldReturn的方法。
我已經實現textFieldShouldReturn方法我在執行文件(.M),它工作正常,但如果頭文件從不與textFieldShouldReturn方法的定義更新那我應該怎麼從來不知道我的實現文件需要實現textFieldShouldReturn方法。
感謝,
謝謝!所以,基本上我必須查找TextFieldDelegate的文檔並正確實施適當的方法? – azamsharp 2010-07-01 14:48:13
是的,這是正確的。 – HerrVoennchen 2010-07-01 23:15:13