UPDATE: Every time I post here I seem to find the answer shortly after. I was looking for the tag in the Notification data when I should have been searching the TextField data. I found it. Sorry!
I have a number of NSTextFields and have given them tags in IB. When I select and change the data in a NSTextField this delegate method is called successfully
When I examine the information of the notification there is no tag information?
I have not implemented any tag code yet since I can't seem to gain access to it? I have about 28 textFields and I need to know which one is selected. I need to use it in this type of code
This seemed easier in IOS then OS X?
I have a number of NSTextFields and have given them tags in IB. When I select and change the data in a NSTextField this delegate method is called successfully
Code:
- (void)controlTextDidChange:(NSNotification *)notification {
NSTextField *textField = (NSTextField *)[notification object];
NSLog(@"controlTextDidChange: stringValue == %@", [textField stringValue]);
sendValue = [[textField stringValue]intValue];
}
Printing description of notification:
NSConcreteNotification 0x6080000498d0 {name = NSControlTextDidChangeNotification; object = <NSTextField: 0x600000184850>; userInfo = {
NSFieldEditor = "<NSTextView: 0x610000121360>\n Frame = {{2.00, 3.00}, {29.00, 17.00}}, Bounds = {{0.00, 0.00}, {29.00, 17.00}}\n Horizontally resizable: YES, Vertically resizable: YES\n MinSize = {29.00, 17.00}, MaxSize = {40000.00, 40000.00}\n";
}}
I have not implemented any tag code yet since I can't seem to gain access to it? I have about 28 textFields and I need to know which one is selected. I need to use it in this type of code
Code:
[myArray objectAtIndex:[textField tag]];
This seemed easier in IOS then OS X?
Last edited: