Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphone voip应用程序退出代码_Iphone_Background_Voip_Exit - Fatal编程技术网

iphone voip应用程序退出代码

iphone voip应用程序退出代码,iphone,background,voip,exit,Iphone,Background,Voip,Exit,我正在实施一个voip应用程序,但autorestart有一个小问题: -当设备打开时,应用程序将自动启动 但是: -在用户从底部栏将其杀死后,应用程序不会重新启动 我做错了什么,或者有没有办法强迫它自动重新启动?或者是一种设置出口代码的方法 谢谢 “代码” [window addSubview:mainViewController.view]; [window makeKeyAndVisible]; g_mainApp = self; _site = false; [StoreManager

我正在实施一个voip应用程序,但autorestart有一个小问题: -当设备打开时,应用程序将自动启动 但是: -在用户从底部栏将其杀死后,应用程序不会重新启动

我做错了什么,或者有没有办法强迫它自动重新启动?或者是一种设置出口代码的方法

谢谢

“代码”

[window addSubview:mainViewController.view];
[window makeKeyAndVisible];
g_mainApp = self;
_site = false;

[StoreManager sharedManager];

[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handlePayment:) name: kProductFetchedNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handlePayment:) name: kInAppPurchaseManagerBuyNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handlePayment:) name: kInAppPurchaseManagerTransactionFailedNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handlePayment:) name: kInAppPurchaseManagerTransactionSucceededNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(handlePayment:) name: kInAppPurchaseManagerTransactionCanceledNotification object: nil];



[mainViewController FirstInit];
int cnt = 0;
while (cnt < 140)
{
    if ([mainViewController GetConnex] != 0)
        break;
    [mainViewController Update];

    [NSThread sleepForTimeInterval:0.1];
    cnt++;
}


return YES;
[窗口添加子视图:mainViewController.view];
[WindowMakeKeyandVisible];
g_mainApp=自我;
_地点=假;
[StoreManager sharedManager];
[[NSNotificationCenter defaultCenter]添加观察者:自选择器:@selector(handlePayment:)名称:kProductFetchedNotification对象:nil];
[[NSNotificationCenter defaultCenter]添加观察者:自选择器:@selector(handlePayment:)名称:kInAppPurchaseManagerBuyNotification对象:nil];
[[NSNotificationCenter defaultCenter]addObserver:自选择器:@selector(handlePayment:)名称:kInAppPurchaseManagerTransactionFailedNotification对象:nil];
[[NSNotificationCenter defaultCenter]添加观察者:自选择器:@selector(handlePayment:)名称:kInAppPurchaseManagerTransactionSucceededNotification对象:nil];
[[NSNotificationCenter defaultCenter]添加观察者:自选择器:@selector(handlePayment:)名称:kInAppPurchaseManagerTransactionCanceledNotification对象:nil];
[mainViewController FirstInit];
int-cnt=0;
而(cnt<140)
{
如果([mainViewController GetConnex]!=0)
打破
[主视图控制器更新];
[NSThread sleepForTimeInterval:0.1];
cnt++;
}
返回YES;

能否共享WindowsDidFinishLaunching选项的代码…我怀疑问题出在那里,因为应用程序没有重新启动,但在暂停时,恢复功能正常。添加了didFinishLaunchingWithOptions的代码,该代码在设备打开时启动,但不是在停止后启动。@SuleaCosmin你有没有发现这个问题?我也遇到了同样的问题。应用程序在设备启动时启动,如果我强制代码崩溃,则会重新启动,但如果用户从底部栏杀死它,则不会重新启动。不,实际上这似乎是预期的行为(用户关闭服务的选项)。我所做的,我还添加了推送通知,如果我检测到用户关闭了应用程序或未连接,我会发送推送通知用户,并让他在需要时打开应用程序。您能否共享WindowsDidFinishLaunching选项的代码…我怀疑问题出在那里,因为应用程序没有重新启动,但在暂停时,恢复功能正常。添加了didFinishLaunchingWithOptions的代码,该代码在设备打开时启动,但不是在停止后启动。@SuleaCosmin你有没有发现这个问题?我也遇到了同样的问题。应用程序在设备启动时启动,如果我强制代码崩溃,则会重新启动,但如果用户从底部栏杀死它,则不会重新启动。不,实际上这似乎是预期的行为(用户关闭服务的选项)。我所做的是,我还添加了推送通知,如果我检测到用户关闭了应用程序或未连接,我会发送推送通知用户,并让他在需要时打开应用程序。