Buenas tardes,
I have a problem with a control inside an nsalert from a thread calling it on the main thread. Everything works fine but the textfield does not respond, you write or delete and it has no response.
dispatch_sync(dispatch_get_main_queue(), ^{
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Enter PIN"];
[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];
NSSecureTextField *input = [[NSSecureTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 24)];
[input setStringValue:@""];
[alertsetAccessoryView:input];
[inputsetEditable:true];
NSInteger button = [alert runModal];
if (button == NSAlertFirstButtonReturn) {
self.pin = [input stringValue];
[self.wait signal];
}else if (button == NSAlertSecondButtonReturn) {
[Utils Log:@"Pin canceled!"];
[alert.window close];
[self.wait signal];
}
});
If I try to create an NSWindow, it comes out as disabled and the controls can't be used either.
Thanks greetings