开发者

UITextField changing into UITextInputTraits

I have a UIViewController subclass that has a UITextField. It is loading from a xib. However, whenever I try to access the roomName instance variable after the view is initialized (e.g. in viewDidLoad), the debugger shows it as UITextInputTraits.

Here is my interface.

@interface AddRoomViewController : UIViewController <UITextFieldDelegate>{
  IBOutlet UITextField *roomName;
  id<AddRoomDelegate> *delegate;
}

- (IBAction)textFieldDidBeginEditing:(UITextField *)textField;

- (void) done;

@property (nonatomic, copy) UITextField *roomName;
@property (nonatomic, assign) id <AddRoomDelegate> *delegate;
@end

I am new to iOS development so I'm sure that I just missed a connection or something, but I am stumped.

Edit: I understand that it is a protocol, bu开发者_运维技巧t when I try to get the text from the UIText Field I get the following error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextInputTraits text]: unrecognized selector sent to instance 0x4d16170' 


UITextInputTraits is a protocol, which UITextField conforms to.


I removed the @property definition for my UITextField and that fixed the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜