【问题标题】:How to reload a UIViewcontroller from background process in iphone?如何从 iphone 的后台进程重新加载 UIViewcontroller?
【发布时间】:2012-07-18 18:26:13
【问题描述】:

目前我正在使用简单的 iphone 应用程序,获取当前设备区域以显示在文本字段中,当我更改区域应用程序运行时间时,按主页按钮应用程序进入后台进程,然后我选择任何区域,再次打开后台应用程序区域无法在该文本字段中更改,但导航另一个屏幕然后进入上一个屏幕区域已更改,但我不想导航到任何其他屏幕,区域自动更改,所以如何重新加载UIViewController,请任何人帮帮我。

提前致谢

-(void)viewDidLoad
{

NSDecimalNumber *amountt = [NSDecimalNumber decimalNumberWithString:@"10.00"];
    NSNumberFormatter *currencyFormatt = [[NSNumberFormatter alloc] init];
    NSLocale *locale = [NSLocale currentLocale];
    [currencyFormatt setNumberStyle:NSNumberFormatterCurrencyStyle];
    [currencyFormatt setLocale:locale];

    NSString *symboll = [NSString stringWithFormat:@"%@",[currencyFormatt stringFromNumber:amountt]];
    NSString *getsymbol = [symboll stringByReplacingOccurrencesOfString:@"10.00" withString:@""];
    NSString *Getdollarsymbol = [getsymbol stringByReplacingOccurrencesOfString:@"10,00" withString:@""];
    NSLog(@"Getdollarsymbol:%@",Getdollarsymbol);

}

【问题讨论】:

    标签: iphone ios uiviewcontroller reload


    【解决方案1】:

    您需要查看您的应用委托。你可以调用你的 UIViewController 从那里更新自己。

    - (void)applicationDidBecomeActive:(UIApplication *)application
    

    【讨论】:

      【解决方案2】:

      您可能还想在

      上收听通知
      UIApplicationDidBecomeActiveNotification
      

      通过 NSNotificationCenter,如果您的应用再次激活,将触发此通知。

      【讨论】:

      • 有个笑话,通知和 NSMutableDictionary 是编写应用程序所需要的。总的来说,这不是做生意的好方法。
      猜你喜欢
      • 1970-01-01
      • 2012-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-02
      • 1970-01-01
      • 2015-11-05
      相关资源
      最近更新 更多