Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Newbie problem with NSTextField
Pengwin Offline
Newbie
*

Posts: 1
Joined: Apr 2013
Post: #1
Newbie problem with NSTextField
I am working on my forst Cocoa project and have come up against a strange problem I cannot solve.
This app is a small menu bar application, with a menu and 2 dialogs.
Then the dialogs are shown, some data is displayed, however, for some reason, the NSTextfields, in fact none of the controls are being updated.

The main delegate have this method to show the window:
Code:
-(IBAction)doAdd:(id)sender
{
    if(!vapingController)
    {
        vapingController = [[kp_VapingSpendController alloc] initWithWindowNibName:@"Add Vaping Spend"];
    }
    [vapingController showWindow:self];
}

whilst in the kp_VapingController, I currently have the following code:

Code:
@interface kp_VapingSpendController ()

@end

@implementation kp_VapingSpendController

- (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.
    [spent setStringValue:@"0.00"];
    [[self window] setTitle:@"Test"];
}

@end

Neither the NSTextField spent, nor the windows title are being updated.

Any help would be greatly appreciated.
2013.07.04 07:35 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)