0
UILabel의 서브 클래스 인 WishInfoTextView를 가진 사용자 정의 UITableViewCell이 있습니다.사용자 정의 UITableViewCell이 중복되지 않게하기
static NSString *CellIdentifier = @"Cell";
NSMutableDictionary* item = [myWishes objectAtIndex: indexPath.row];
WishTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if(cell == nil) {
cell = [[WishTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
[cell setSelectionStyle: UITableViewCellEditingStyleNone];
[cell setWishInfo: item];
}
WishInfoTextView* infoText = (WishInfoTextView*)[cell viewWithTag: kTableInfoText];
infoText.text = [item objectForKey:@"name"];
NSLog(@"\nTaggedText: %@\nNormalText: %@", infoText.wishName, [item objectForKey:@"name"]);
문제는 내가 중복 된 셀을 가지고 있다는 것입니다. 나는 태그를 설정하는 것에 대해 읽었습니다. 하지만 태그로 내 라벨에 액세스하면 아무 것도 변경되지 않습니다.
정적는 NSString * CellIdentifier = @이다
의해 입수되고 사용 "세포"; NSMutableDictionary * item = [myWishes objectAtIndex : indexPath.row]; 죄송합니다.이 부분은 코드 블록에서 제외되었습니다. 그래서 그게 문제가 아니야 – reapertjuh
그게 네가 쓰고있는거야? 그것은 모두 귀하의 plist의 구조에 따라 달라집니다 – Dustin
내 예제에서 반대 순서 때문에 – Dustin