gpt4 book ai didi

iPhone 应用程序崩溃(仅限 iOS4)

转载 作者:太空狗 更新时间:2023-10-30 03:38:38 25 4
gpt4 key购买 nike

我的 iPhone 应用程序在安装后第一次运行时偶尔会崩溃。在此之后,每次我尝试运行该应用程序时,它都会保留在启动画面甚至黑屏上,直到最终消失。我必须重新启动设备才能使应用程序正常工作。在此之后它每次都能正常工作。 OS3 代码和 4 之间的唯一变化是属性“UIApplicationExitsOnSuspend”强制应用程序每次都重新加载而不是挂起。任何帮助都会很棒。

下面是两个代码片段:

- (void)applicationDidFinishLaunching:(UIApplication *)application 
{
taskListViewController = [[TaskListViewController alloc] initWithNibName:@"TaskListView" bundle:nil];
taskListViewController.managedObjectContext = self.managedObjectContext;

[taskListViewController setAppDefaults];

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:taskListViewController];
[taskListViewController release];

navController.navigationBar.tintColor = [UIColor blackColor];

[window addSubview:[navController view]];
[window makeKeyAndVisible];

- (void)viewDidLoad 
{
NSLog(@"viewDidLoad - Start");
[super viewDidLoad];

NSError *error = nil;
if(![[self fetchedResultsController] performFetch:&error])
{
NSLog(@"Error with initial fetch %@, %@", error, [error userInfo]);
}

[activityIndicator startAnimating];

self.navigationItem.leftBarButtonItem.enabled = NO;
self.navigationItem.rightBarButtonItem.enabled = NO;
infoButton.enabled = NO;
syncButton.enabled = NO;

taskListTable.userInteractionEnabled = NO;
taskListTable.allowsSelection = NO;

checkingRecovery = true;
[self insertCheck];
}

上述其他方法:

    [taskListViewController setAppDefaults]
[self insertCheck];

setAppDefaults - 如果用户尚未在 peferences 中设置 defaultValues,则枚举设置包将 defaultValues 应用于 NSUserDefaults。

insertCheck - 对数据库执行一些查询以确保录音文件的完整性,但在这种情况下,因为这是第一次加载应用程序,所以它不会执行任何操作。

更新:

我已经注释掉了额外的方法调用(上面的两个),但我仍然遇到问题。

我在苹果开发者论坛上发现有几个人遇到了同样的问题,但没有解决方案。一个回复来自一位遇到同样问题的用户,但该应用程序确实在应用程序商店中获得批准。

谢谢小杰

最佳答案

如果您正在调试崩溃的应用程序,您应该得到一个堆栈跟踪,它会告诉您应用程序在哪一行崩溃。

如果您可以提供堆栈跟踪信息,那么找到崩溃原因会容易得多。

关于iPhone 应用程序崩溃(仅限 iOS4),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3299009/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com