2012-06-29 4 views

답변

1
- (void)someAction:(id)sender 
{ 
    // do something (like pushing a new view) 
    //when the user hits <enter> in the text field 
} 

는 자세한 내용

[myTextField setTarget:self]; 
[myTextField setAction:@selector(someAction:)]; 
+0

.... http://developer.apple.com/library/ios/#DOCUMENTATION/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement을 ...이 라인을 사용합니다. html # // apple_ref/doc/uid/TP40009542-CH5-SW5 – Nishant

+0

최신 XCode에서 NSTextField ca n에는 다른 동작 모드가 있습니다. 기본적으로 NSTextField는 "End on Editing"으로 설정됩니다.이 기능은 어떤 이유로 든 편집을 중지 할 때마다 작업을 보냅니다 (예 : 멀리 탭). 그러나 Interface Builder에서 속성 빌더를 "Enter on Only"(속성 탭의 "Text Field"그룹 아래쪽으로)로 전환하여 사용자가 실제로 enter를했을 때만 액션을 보낼 수 있습니다. – Nishant

+0

답장을 보내 주셔서 감사합니다. – krishh

관련 문제