IOS应用程序在使用选项完成启动后冻结
我正在制作一个IOS应用程序,从didFinishWIthLaunchingWithOptions返回后,该应用程序会冻结IOS应用程序在使用选项完成启动后冻结,ios,xcode,Ios,Xcode,我正在制作一个IOS应用程序,从didFinishWIthLaunchingWithOptions返回后,该应用程序会冻结 -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bound
-(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;
}
检查所有的变量让我相信一切都很顺利。我在输出中没有看到任何错误或消息。但是,函数返回后,应用程序将冻结
我注意到这种冻结有一些奇怪的地方。首先,当我在冻结期间暂停执行时,应用程序有一个调用堆栈,如下所示:
马赫数味精陷阱
马丘味精
等
等
主要
没有我的代码在那里,一直回到我的单行主线
接下来,这种冻结只发生在运行iphone模拟器时。ipad模拟器工作正常,将应用程序放在手机上并运行它也是如此
有什么想法吗?谢谢 我觉得你的代码很好, 也许问题就在这里
//Set to interactive mode
[self.viewController.motionController setInteractiveMode:TRUE];
[self.viewController.motionController recoverSML];
[self.viewController.motionController startRecording];
我认为xcode中的默认模拟器不支持加速计、麦克风和摄像头。可能访问其中任何一个都会导致冻结。我记得在模拟器上访问摄像头时崩溃了
虽然你在iPad模拟器上不崩溃很奇怪。这只是我的猜测。在
didsfinishwithlaunchingwithoptions
中发布您的代码。您很可能正在尝试访问已发布的内容。您正在使用ARC吗?您是否更改了应用程序:didFinishLaunchingWithOptions
?如果是的话,你能发布代码吗?谢谢,是的。我已经编辑了上面的帖子来显示它。这里也有同样的问题。但是这个问题是由一个用户报告的。我不能在我身边复制它。