संग्रह विचारों के साथ पहली डुबकी ले रहा है और इस त्रुटि में चल रहा हूँ:त्रुटि तरह के एक दृश्य के विपंक्ति नहीं कर सका UICollectionElementKindCell
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
कोड बहुत सरल है, जिन्हें आप नीचे। मैं अपने जीवन के लिए यह नहीं समझ सकता कि यह क्या है कि मैं याद कर रहा हूं।
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
cell.backgroundColor = [UIColor whiteColor];
return cell;
}
संग्रह दृश्य नियंत्रक एक निब और प्रतिनिधियों & datasources दोनों फ़ाइल के मालिक की तैयारी में हैं का उपयोग कर बनाया गया था।
देखें नियंत्रक की हेडर फ़ाइल भी वास्तव में मूलभूत है।
@interface NewMobialViewController_3 : UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@end
[स्वयं।संग्रह दृश्य रजिस्टर क्लास: [UICollectionViewCell क्लास] के लिए CellWithReuseIdentifier: @ "सेल"]; –