Je commence juste avec le développement d'OSX, et j'essaye d'obtenir des notifications de délégué d'un NSTextField. J'ai le code suivant à ce jour:Problème de délégué avec NSTextField
C'est là que je mets le délégué:
- (void) awakeFromNib {
NSLog(@"Setting delegate");
[amountField setDelegate: [[TextfieldController alloc] initWithLog]];
}
Et voici mon TextfieldController:
- (TextfieldController *) initWithLog {
self = [super init];
NSLog(@"TextfieldController initialized");
return self;
}
- (void)textDidChange:(NSNotification *)aNotification {
NSLog(@"textdidChange");
}
- (void)keyUp:(NSNotification *)aNotification {
NSLog(@"keyUp");
}
Cependant, ni textDidChange ni keyUp est jamais appelé ... Je ne sais pas ce qui me manque ici, parce que la même manière fonctionne très bien quand je l'utilise pour ma fenêtre principale avec la notification windowDidMiniaturize ...
o aider? :)