Pregunta

Aquí está mi problema: tengo un mainwindow.xib, window1.xib, window1controller.h, window1controller.m puedo mostrar Window1 desde mainwindow, pero el valor de paso no se muestra en Window1, sé que ese valor está listo para mostrar, creo Un botón en Window1 y puedo invocar este valor. ¿Cómo puedo mostrar el valor de aprobación después de la ventana cargada1?

Aquí está mi código:

Appdelegate.m

- (IBAction)openWindow1:(id)sender {
    Window1Controller *w1 = [[Window1Controller alloc]initWithWindowNibName:@"Window1"];
    [w1 showWindow:nil];
}

Window1Controller.m

- (void)displayInfo {
    [label setStringValue:@"sample passed text"];

    NSLog(@"%@",[label stringValue]);
}

- (id)initWithWindow:(NSWindow *)window
{
    self = [super initWithWindow:window];
    if (self) {
        // Initialization code here.
    }

    return self;
}

- (void)windowDidLoad
{
    [super windowDidLoad];

    // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.

    [self displayInfo];
}

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top