嗨朋友我的應用程序崩潰點擊單元格bec我對這條線rowToSelect = indexPath;。但我需要這一行我必須通過所有行選擇cellbackground圖像上的圖像當我點擊SECTION1 ==排== 0,那麼我得到這個錯誤如何避免iphone中的單元格選擇錯誤
' - [__ NSArrayM行]:無法識別的選擇發送到實例0x4c7080' *第一擲調用堆棧:(0x37e378bf 0x379831e5 0x37e3aacb 0x37e39945 0x37d94680 0x319921e9 0x319921af 0x5b47 0x3193f9cb 0x3193eaa9 0x3193e233 0x318e2d29 0x37d9622b 0x37430381 0x3742ff99 0x3743411b 0x37433e57 0x3742bd85 0x37e0bb4b 0 x37e09d87 0x37e0a0e1 0x37d8d4dd 0x37d8d3a5 0x37b64fcd 0x3190d743 0x2927 0x28dc)terminate 調用throwing exceptionProgram received signal:「SIGABRT」。數據 格式化程序暫時不可用,將在「繼續」後重新嘗試。 (找不到dlopen的功能,所以它是不可能載入共享 庫)。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
rowToSelect=indexPath;//when i remove this line then my application is not crashing but when i keep
this line the i click section1 and row0 then application is crash why this happen where i am wong please help me
UIViewController <SubstitutableDetailViewController> *detailViewController = nil;
if ([indexPath row] == 0 && [indexPath section] == 0) {
TodoDetailViewController *newDetailViewController = [[TodoDetailViewController alloc] initWithNibName:@"TodoDetailViewController" bundle:nil];
detailViewController = newDetailViewController;
}
if ([indexPath row] == 0 && [indexPath section] == 1){
PeopleViewController *newDetailViewController = [[PeopleViewController alloc] initWithNibName:@"PeopleViewController" bundle:nil];
detailViewController = newDetailViewController;
}
if ([indexPath row] == 1 && [indexPath section] == 1){
DocumentsViewController *newDetailViewController = [[DocumentsViewController alloc] initWithNibName:@"DocumentsViewController" bundle:nil];
detailViewController = newDetailViewController;
}
if ([indexPath row] == 2 && [indexPath section] == 1){
PlannerViewController *newDetailViewController = [[PlannerViewController alloc] initWithNibName:@"PlannerViewController" bundle:nil];
detailViewController = newDetailViewController;
}
if ([indexPath row] == 0 && [indexPath section] == 2){
ArchivedPeopleViewController *newDetailViewController = [[ArchivedPeopleViewController alloc] initWithNibName:@"ArchivedPeopleViewController" bundle:nil];
detailViewController = newDetailViewController;
}
// Update the split view controller's view controllers array.
NSArray *viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
splitViewController.viewControllers = viewControllers;
if (popoverController !=nil)
{
[popoverController dismissPopoverAnimated:YES];
}
.
if (rootPopoverButtonItem != nil) {
[detailViewController showRootPopoverButtonItem:self.rootPopoverButtonItem];
}
[detailViewController release];
}
什麼類型是'rowToSelect'場? – 2012-07-11 05:56:00