Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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
Ios &引用;无法监视事件循环“;崩溃_Ios_Objective C_Xctest_Uitest - Fatal编程技术网

Ios &引用;无法监视事件循环“;崩溃

Ios &引用;无法监视事件循环“;崩溃,ios,objective-c,xctest,uitest,Ios,Objective C,Xctest,Uitest,我添加了断点,发现它阻塞了 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ // init local data [[PDKeychainBindings sharedKeychainBindings] setObject:@"0" forKey:kNEED_GESTURE_LOGIN]; // regist

我添加了断点,发现它阻塞了

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
// init local data
    [[PDKeychainBindings sharedKeychainBindings] setObject:@"0" forKey:kNEED_GESTURE_LOGIN];

    // register notification to notice switching RootVC
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(switchRootControllerWithType:)
                                                 name:kNoti_SwitchRootView
                                               object:nil];

    // init the third part SDK
    [self setupShareSDK];
    [self setupBugly];
    [self setupUMeng];
    [self setupIQKeyBoard];
    [self setupZhugeIOWithOptions:launchOptions];
    [self setupTrusfort];   
    // register push service
    [self setupJPushWithOptions:launchOptions];
    [self dealWithRemoteNotification:launchOptions];

    // set local flag
    [KXUserIntroManager setupFlag];

    if (self.remoteNotification) {
        if ([AccountStateManager isLogin])
            [self.loginNavigationController showGesturePDViewController];
        self.window.rootViewController = self.loginNavigationController;

    } else { 
        self.window.rootViewController = self.launchController;
    }
    return YES;
}
我还尝试了stackOverFlow中的方法,在上面的方法中添加以下代码

    NSArray *args = [NSProcessInfo processInfo].arguments;
    for(NSString *arg in args){
        if ([arg isEqualToString:@"NoAnimations"]) {
            [UIView setAnimationsEnabled:false];
        }
    }

这是didFinishLaunching方法的细节。它只是初始化一些数据并创建一个通知

虽然这并不是对您的问题的直接回答,但很可能您的问题反映了一个非常明显的事实,即您在
didFinishLaunchingWithOptions
的主线程上做了太多的工作。在这种方法中,您的主要工作是让路,让运行时启动应用程序。你做的恰恰相反

这个问题有点复杂。我无法清楚地描述它。您可以提出可能导致此问题的原因,然后我们可以一起讨论。您需要提供更多代码。告诉人们系统回调崩溃是不够的。发布您编写的测试,发布didFinishLaunchingWithOptions方法的内容。也可以尝试类似的方法,看看是否有帮助:谢谢你的建议,我只使用xcode提供的ui测试包,运行测试示例而不做任何更改。上面说“未收到应用程序事件循环空闲通知”。请不要发布代码图片。对不起,我现在正在更新我收到了你的消息,但是当我调试应用程序时,它可以正常运行。它只是在运行测试示例时崩溃并报告“未收到应用程序事件循环空闲通知”。我真的很困惑:(.当您调试应用程序时,WatchDog进程会关闭,并且不会在启动时间过长时终止您的应用程序。UI测试可能不是这样。无论如何,正如我所说,这是一个您需要处理的问题,因此您最好开始处理它。非常感谢,我将尽最大努力解决它。如果您有其他问题,我会DEA,我们可以在这里讨论。:)