UITableView로드하는 것처럼 numberOfSectionsInTableView 액세스 : 두 번 및 "EXC_BAD_ACCESS"함께 응용 프로그램 충돌. 나는 전에 이것을 경험하지 못했습니다.UITableView mberOfSectionsInTableView 두 번 액세스 및 충돌
numberOfSectionsInTableView : 테이블 뷰의 초기로드를 수행 할 때 두 번 액세스해야합니까?
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
NSLog(@"numberOfSectionsInTableView");
// Return the number of sections.
NSLog(@"Count: %i", [self.playerArray count]);
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSLog(@"numberOfRowsInSection");
// Return the number of rows in the section.
NSLog(@"time for return");
return [self.playerArray count];
}
응답이다
2010-11-20 19 : 35 : 06.459 FamQuiz_v2 [10151 : 207] numberOfSectionsInTableView
현재 언어 : 자동; 현재 목표 -C
2010-11-20 19 : 35 : 12.408 FamQuiz_v2 [10151 : 207] 개수 : 2
(GDB)를 계속
2010-11-20 19 : 35 : 28.918 FamQuiz_v2를 [10151 : 207] numberOfSectionsInTableView
프로그램 수신 신호 : "EXC_BAD_ACCESS".
프로그램 수신 신호 : "EXC_BAD_ACCESS".
}
"numberOfSectionsInTableView"에 [playerArray retain]을 넣었지만 제대로 작동했습니다. 이유는 그것이 두 번 액세스되었다는 것이 겠지요. – PeterK
BIG 감사합니다.이 포럼에있는 사람들은 매우 놀랍습니다 .- – PeterK
. 그것이 만들어 질 때 제대로 유지되는지 확인하십시오. – TomSwift