I have a problem with my program. Basically what I want, I have 2 nssecuretextfield and I have a button. if both are equal, it shows one image in the nsimageview view, if it does not display another image. It can be very easy, but I'm new to programming on Mac,
.h file:
IBOutlet NSSecureTextField *textField; IBOutlet NSSecureTextField *textField2; IBOutlet NSImageView *imagem; } - (IBAction)Verificarpass:(id)sender;
.m file:
- (IBAction)Verificarpass:(id)sender; { NSString *senha1 = [textField stringValue]; NSString *senha2 = [textField2 stringValue]; NSImage *certo; NSImage *errado; certo = [NSImage imageNamed:@"Status_Accepted.png"]; errado = [NSImage imageNamed:@"Error.png"]; if (senha1 == senha2) { [imagem setImage:certo]; } if (senha1 != senha2) { [imagem setImage:errado]; } }
Can anyone help me? I tried and it only displays 1 image, even if it is right or wrong.
source share