Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSTextView doesn't call controlTextDidChange:

I have a class ("TextEditorViewController") within there is a NSTextView ("textView") Object. I've connected it with the NSTextView in my .xib file. Here my .h file:

#import <Foundation/Foundation.h>

@interface TextEditorViewController : NSObject {
    IBOutlet NSTextView *textView;           // connected in MainMenu.xib
    IBOutlet NSTextField *displayCharacters; // connected in MainMenu.xib
}

@end

And here is my .m file:

#import "TextEditorViewController.h"    

@implementation TextEditorViewController

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSLog(@"applicationDidFinishLaunching called"); // printed to the debugger
    [textView setDelegate:(id)self];
}

- (void)controlTextDidChange:(NSNotification *)obj {
    NSLog(@"controlTextDidChange called"); // don't printed to the debugger ???
    [displayCharacters setIntValue:[[textView string] length]];
}

@end

But when I change the text in my NSTextView it don't call controlTextDidChange:! Why?

Thanks for answers! =)

like image 948
qwertz Avatar asked Nov 13 '22 09:11

qwertz


1 Answers

It worked after rebuilding the files in a new project. Seems like a file management configuration issue.

like image 194
qwertz Avatar answered Dec 21 '22 07:12

qwertz