서브 클래스가 UICollectionViewCell
이고 배경색이 UIView
인 하위 클래스 만 표시되어 현재 있음을 나타냅니다. XIB에서로드하기 위해XIB에서로드 할 때 UICollectionViewCell에서 충돌이 발생합니다.
, 나는이를 교체해야이와
- (void)viewDidLoad {
[super viewDidLoad];
[self.localPlayerItemsView registerClass:[MBTradeCollectionViewCell class]
forCellWithReuseIdentifier:CellIdentifier];
}
:
- (void)viewDidLoad {
[super viewDidLoad];
UINib *nib = [UINib nibWithNibName:@"MBTradeCollectionViewCell" bundle:nil];
[self.localPlayerItemsView registerNib:nib forCellWithReuseIdentifier:CellIdentifier];
}
그렇게되면, 그때 collectionView:cellForItemAtIndexPath:
의 첫 번째 줄에 충돌을 얻을 :
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
MBTradeCollectionViewCell *aCell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier
forIndexPath:indexPath];
return aCell;
}
는 충돌의
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0x7d461780> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key itemCountView.'
registerClass:forCellWithReuseIdentifier:
을 사용할 때이 크래시가 발생하지 않지만 내 xib가로드되지 않습니다.
itemCountView에 대한 사용자 정의 셀 콘센트 연결을 확인하십시오. – BhushanVU
IBOutlet과 같은 소리가 잘못 연결됩니다. 펜촉의 모든 연결을 확인하십시오. – Rayfleck
[이게 무슨 뜻입니까? " 'NSUnknownKeyException', 이유 : ...이 클래스는 키 값 X와 호환되는 키 값이 아닙니다."] (http://stackoverflow.com/questions/3088059/what-does-this-mean-nsunknownkeyexception-reason- 이 클래스는 키가 아니다) –