언어/IPhone

xcode textfield next 구현

Mustang 2013. 1. 15. 13:35

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
if (textField == txtUsername) {
[txtPassword becomeFirstResponder];
}
else if (textField == txtPassword) {
[txtEmail becomeFirstResponder];
}
[textField resignFirstResponder];
return YES;
}

소스는 간단한데 implement delegate를 해줘야 한다고 해서 한참 헤맸다 ...

http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uitextfield-uitextfielddelegate/

여기에 해결법이 나와있음.

UITextField - project setup간단하게 이걸 해주면 되는거였는데.. 몰라서 한참 해맸다..

Stroy Board 를 사용할 경우 File's Owner가 없으므로 해당 Controller를 선택해 주면 된다.