Hi list,

I've added a new window to my application and have written a window
controller class. Everything is going fine, except for the fact that
when initialising the window, none of my IBOutlets are responding to
methods called on them. This is the case in both the init and
windowDidLoad methods - NSButtons are not responding to setEnabled
methods, NSTextFields are not responding to setStringValue methods,
etc. All relevant UI elements are visible but are not responding. No
warnings and nothing appearing in the console.

After the window has been initialised and loaded and after I begin to
interact with it (IBAction methods work fine) then my outlets respond
just fine. Very strange.

Here is how I'm creating the object:

m_LicensingWindow = [[[LicensingWindowController alloc] init] retain];

Part of the Declaration. I've snipped out many irrelevant parts of the
code for the sake of readability:

#import <Cocoa/Cocoa.h>

@interface LicensingWindowController : NSWindowController
{
    IBOutlet NSWindow * m_MainWindow;
    IBOutlet NSWindow * m_licensingPanel;
        
    IBOutlet NSButton * m_EditLicenseButton;
    IBOutlet NSTextField * m_EmailConfirmTextbox;
    IBOutlet NSTextField * m_EmailTextbox;
    IBOutlet NSButton * m_GetNewLicenseButton;
    IBOutlet NSTextField * m_HardwareKeyText;
    IBOutlet NSButton * m_HideProductsCheckbox;
    IBOutlet NSTextField * m_LicenseInfoLabel;

// snip
}

- (IBAction)showLicensingWindow:(id)sender;
- (bool)populateProductsPopupList;
- (IBAction)changeEmailAddressAction:(id)sender;
- (IBAction)changeEmailConfirmAddressAction:(id)sender;

// snip
@end

And part of the definition:

#import "LicensingWindowController.h"
#include <CoreFoundation/CoreFoundation.h>

// snip

@implementation LicensingWindowController

- (void) init
{
        if ((self = [super initWithWindowNibName: @"LicensingWindow"]) != nil)
    {
                // IBOutlets not responding here
        }
}

- (void) windowDidLoad
{
// not responding here
        [m_GetNewLicenseButton setEnabled: NO];
        [m_HardwareKeyText setStringValue: @"Test"]];
}

- (IBAction)showLicensingWindow:(id)sender
{
        [super showWindow:self];
}

- (IBAction)clickGetNewLicenseAction:(id)sender {
        // responding fine here!
}

// snip
@end


Any ideas? Is there a problem in the ordering somewhere? Its probably
something very basic but I'm stumped!

Many thanks,
Cormac
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to