-1
我正在做一个IOS应用程序,并从didFinishWIthLaunchingWithOptions返回后,应用程序冻结。IOS应用程序冻结后didFinishWithLaunchingWithOptions
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[FooPlatformViewController alloc] init];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
//Set to interactive mode
[self.viewController.motionController setInteractiveMode:TRUE];
[self.viewController.motionController recoverSML];
[self.viewController.motionController startRecording];
return YES;
}
检查在那里所有的变量使我相信一切正常。我在输出中看不到任何错误或消息。但是,函数返回后,应用程序冻结。
我注意到了这个冻结的一些奇怪的事情。首先,当我在冻结期间暂停执行,该应用程序有一个调用堆栈看起来像:
mach_msg_trap
mach_msg
等
等
主要
没有我的代码在那里,一直回到我的单线主。
接下来,此冻结只发生在运行iphone的模拟器。 iPad的模拟器工作正常,因为把应用程序放在手机上并运行该应用程序
任何想法?谢谢!
发布**'didFinishWIthLaunchingWithOptions' **中的代码。您很可能试图访问已发布的内容。你在使用ARC吗? – WrightsCS
ARC打开。 – Tyler
您是否改变过'application:didFinishLaunchingWithOptions'?如果是这样,你可以发布代码吗?谢谢。 – pasawaya