当应用程序进入前台时,我想更改视图控制器中的标签....:
SalaryAppV4AppDelegate.h
@interface SalaryAppV4AppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
//----------------------------------------------
NSTimeInterval appEnteredBackground;
NSTimeInterval appEnteredForeground;
NSTimeInterval difference;
NSString *times;
//-----------------------------------------------
SalaryAppV4AppDelegate.m
- (void)applicationWillEnterForeground:(UIApplication *)application
{
//perform -(IBAction)DoThis
FirstViewController* controller = [FirstViewController alloc];
[controller DoThis];
//releasing
[dateFormatter release];
}
第一视图控制器.m
-(IBAction) DoThis
{
appDelegate = [[[UIApplication sharedApplication] delegate] retain];
//This Doesn't Work :(
label.text = @"IT Has Worked";
//This Works
NSLog(@"%@", appDelegate.times);
}
//--------------------------------------------------------
我只想将 label.text ti 更改为任何内容,但 viewcontroller 中没有任何更改...