我正在开发一个从parse.com读取数据库的应用程序,其坐标在MapKit-map上绘制。一切正常,但是当我在parse.com网站上手动添加新的图钉时,在按下手机上的主页按钮后打开应用程序时它不会显示。
我在哪里以及如何询问该应用是否被击落?
希望我以一种可以理解的方式解释。
每次使用launch-image等打开应用程序时,从头开始也可以很好。但我认为这是不可能的,因为人们总是必须通过双击手机来关闭背景中的应用程序。
感谢答案
答案 0 :(得分:0)
如果'app已被击落',则表示应用程序在按下主页按钮后移至后台,然后要了解此事件,您需要在appdelegate.m中实施applicationDidEnterBackground:
方法
当您启动一个新项目时,这些函数以及注释都是由xcode创建的。
- (void)applicationDidEnterBackground:(UIApplication *)application
{
NSLog(@"App Background");
/* Use this method to release shared resources, save user data,
invalidate timers, and store enough application state information
to restore your application to its current state
in case it is terminated later.
If your application supports background execution,
this method is called instead of applicationWillTerminate:
when the user quits.
*/
}
要知道应用程序何时再次打开,请在appdelegate.m中实施applicationDidBecomeActive:
方法
- (void)applicationDidBecomeActive:(UIApplication *)application
{
NSLog(@"App Active");
/* Restart any tasks that were paused (or not yet started)
while the application was inactive.
If the application was previously in the background,
optionally refresh the user interface.
*/
}