저는 UITableView와 맞춤형 셀을 가지고 있습니다. 셀에 나는 UILabel이 있지만, 텍스트를 UILabel로 설정하기 전에 다른 텍스트의 텍스트를 찾고 텍스트를 강조 표시 한 다음 레이블로 설정합니다. 그래서 목록을 스크롤하면이 힘든 일 때문에 지연이 있습니다. 성능 향상 방법에 대한 아이디어가 있습니까? 어쩌면 다른 스레드에서 모든 노력을 할 수 있을까요 ??iPhone : UITableView를 통한 원활한 스크롤
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
(NSIndexPath *)indexPath {
static NSString *customCellIdentifier =
@"CellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
customCellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomTableRow"
owner:self options:nil];
if (nib.count > 0) {
cell = self.customTableRow;
}
}
self.myLabel.text = [self giveMeTheTextThatINeed];
return cell;
}
[self giveMeTheTextThatINeed] - 약간의 시간이 걸리는 텍스트에 대해 열심히 노력했습니다.
그게 최선의 방법이라고 생각합니다. 튜토리얼 호가 그걸 깨닫고 있습니까? – Jim
정말 그다지 그다지 중요하지 않습니다. 스레드 풀 호출에서 메소드를 랩핑하십시오 : NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; ARC를 사용하지 않는 경우 [poo release]; 그런 다음 [pool release] 직전에 - (void) reloadRowsAtIndexPaths : (NSArray *) indexPaths withRowAnimation : (UITableViewRowAnimation) 애니메이션을 호출합니다. –