I am using Cocoa with Obj C coding.
I have a NSSecureTextfield. I implemented the delegate controlTextDidChange to monitor whether the control is empty or nil and depending on that I am activating login button.
I am running the application from console so that I can see the statements.
I am always getting the message "NO" printed on the console.
And nothing is displayed for password.
How to handle this situation.
I have a NSSecureTextfield. I implemented the delegate controlTextDidChange to monitor whether the control is empty or nil and depending on that I am activating login button.
Code:
-(void) controlTextDidChange:(NSNotification *)aNotification
{
NSLog(@"Text changed: %@",[password stringValue]);
if([aNotification object] == password)
{
if( [[password stringValue] isEqualToString:@""] )
{
NSLog(@"NO");
[loginButton setEnabled:NO];
}
else
{
NSLog(@"YES");
[loginButton setEnabled:YES];
}
}
}
I am running the application from console so that I can see the statements.
I am always getting the message "NO" printed on the console.
And nothing is displayed for password.
How to handle this situation.