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! =)
It worked after rebuilding the files in a new project. Seems like a file management configuration issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With