【发布时间】:2020-03-27 22:55:52
【问题描述】:
我添加断点,发现它阻塞在方法中
- (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];
}
}
Image link
是 didFinishLaunching 方法的细节。它只是初始化一些数据并创建一个通知
【问题讨论】:
-
这个问题有点复杂。我无法清楚地描述它。您可以提出可能导致此问题的原因,然后我们一起讨论。
-
您需要提供更多代码。告诉人们它崩溃的系统回调是不够的信息。贴出你写的测试,贴出didFinishLaunchingWithOptions方法的内容。也尝试这样的事情,看看它是否有帮助:stackoverflow.com/questions/40156203/…
-
感谢您的建议,我只是使用 xcode 提供的 ui-test 包并运行测试示例而无需任何更改。它说“未收到应用程序事件循环空闲通知”。
-
请勿发布代码图片。
-
对不起,我正在更新
标签: ios objective-c xctest uitest