Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MayPeng

macrumors member
Original poster
Nov 21, 2010
53
0
I have a controller class : AppController

AppController.h
IBOutlet NSTextField *m_field_status;

- (void)setStatus;
- (void)finishUpgrading;


AppController.m
- (id)init
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:mad:selector(finishUpgrading) name:EnumerationFinishedNotification object:nil];
}

- (void)setStatus
{
[m_field_status setString: @"Starting..."];
}

- (void)finishUpgrading
{
NSString *str = @"Starting...";
[str stringByAppendingString:mad:"finished"];
[m_field_status setString:str];
}

I have another class: Upgrade. It will post Notification (finishUpgrading) to AppController class after finishing the upgrading.

Now the problem is that the NSTextField can't show message immediately after receiving the notification.

I have loaded the current view after receiving the notification.But it can't make any sense.
 
(Re-)read the NSNotificationCenter class reference. In particular, the requirement stated under notificationSelector of addObserver:selector:name:object:.

More detailed information is available in the Notification Programming Topics guide.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.