升级到iOS 4.2后iPhone应用程序无法运行

问题描述:

安装Xcode 3.2.5 iOS 4.2后,完美工作的应用程序停止工作。我已经看到,这发生在其他人身上,但不知道如何解决它。升级到iOS 4.2后iPhone应用程序无法运行

我的问题是: 1.我怎么知道它在哪里崩溃? 2.我能做些什么来更好地调试和查明问题。

这是调用堆栈。

Call Stack

汤米感谢您的回答。我已经构建并运行并提出建议,但是当它崩溃时,它不会显示它崩溃的位置。此外,我在该方法内部添加了一个断点,但它并没有停在那里。还有什么想法?这是代码片段。

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 
ApplicationData *appdata = [ApplicationData sharedInstance]; 
if(appdata.currentCategoryIndex >= 0) { 
    Category *category = [appdata.categoryList objectAtIndex:appdata.currentCategoryIndex]; 
    if(category.records) { 
     [lab_norecords setHidden:YES]; 
    } else { 
     [lab_norecords setHidden:NO]; 
     return 0; 
    } 
    return [category.records count]; 
} 
return 0; 

}

enter image description here

现在我收到此错误:

enter image description here

我认为,问题的根源就在这里在同一subCategoryView:

- (id)init { 
if([[NSBundle mainBundle] loadNibNamed:@"SubCategoryView" owner:self options:nil]) { 
    //if(self = [super initWit]) 
    cellowner = [[TableCellOwner alloc] init]; 
    [listTableView setBackgroundColor:[UIColor clearColor]]; 
    [listTableView setSeparatorColor:[UIColor whiteColor]]; 
    [listTableView initialize]; 
} 
return self; 

}

从你有的踪迹,看看第二栏。你的应用程序中最近的事情是在第四行(编号为'3'的那一行)对SubCategoryView numberOfSectionsInTableView:的调用。触发的异常是NSRangeException,您尝试从其中包含22个对象的数组中检索对象4294967295。 4294967295是如何-1看起来,如果你投了32位签约数的无符号数,所以出于某种原因,你正在做的事情,如:

NSInteger variable = -1; 
[array objectAtIndex:variable]; 

某处SubCategoryView的numberOfSectionsInTableView内。最佳直接猜测:4.1和4.2之间的某些变化会导致您使用任何方法填充表以提供错误的结果。

要从这里前进,请确保您正在执行调试构建并使用command + y启动(或转至构建,构建和运行 - 断点开启)。当这次你的程序崩溃时,应该出现调试窗口,显示你的程序到底是哪一行引发异常,并允许你检查当时所有程序变量的状态。调试器还可以让你放置断点,一次一行地执行你的程序和所有其他常见的事情。

+0

@Tommy我编辑了我的文章,你可以看看看看你是否可以得到进一步的帮助?我被卡住了。 – ldj 2011-02-20 12:32:38