2013-01-12 2 views

답변

0

NSTextField의 대리인으로 개체를 설정해야합니다. NSTextFieldNSControl의 하위 클래스이므로 구현하면 개체에 -controlTextDidChange: 메서드가 호출됩니다.

@interface MyObject : NSObject 
{ 
    IBOutlet NSTextField* textField; 
} 
@end 

@implementation MyObject 
- (void)awakeFromNib 
{ 
    [textField setDelegate:self]; 
} 

- (void)controlTextDidChange:(NSNotification *)aNotification 
{ 
    if([notification object] == textField) 
    { 
     textField.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:14]; 

    } 
} 
@end 
관련 문제