Cuándo actualizar una vista cuando la aplicación iOS se recupera de inactiva / suspendida

My app has time-sensitive information in a view that will need to be updated, when the app is recalled by the user, from an inactive/suspended state. Which of the two app delegate methods below should handle this?

Aquí:

- (void)applicationDidBecomeActive:(UIApplication *)application{

 //Check to see if we need to refresh a view
 if([self needToRefreshView])
   [viewcontroller1 refreshView];

}

or

Aquí:

- (void)applicationWillEnterForeground:(UIApplication *)application{


   //Check to see if we need to refresh a view
   if([self needToRefreshView])
   [viewcontroller1 refreshView];


 }

Is one method better suited for this than the other? If so, Why?

Muchas Gracias

preguntado el 09 de marzo de 12 a las 14:03

1 Respuestas

Those should both work fine, the only other that I would consider implementing your code in is viewWillAppear.

respondido 09 mar '12, 15:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.