NSNotificationCenter - UIApplicationWillEnterForegroundNotification需要太长时间

时间:2015-02-27 14:52:56

标签: swift nsnotificationcenter

我的代码:

overide func viewDidLoad() {
   NSNotificationCenter.defaultCenter().addObserver(self, selector: "activeAgain", name: UIApplicationWillEnterForegroundNotification, object:nil)
}

func activeAgain() {
   println("ActiveAgain") //Comes immediately
   callSeparateFunction() //Takes 5s
}

为什么println立即出现,单独的函数调用最多需要5s?当应用程序回到前台时,我必须调用一个新函数。谢谢!

0 个答案:

没有答案