मैं आईबी में बनाए गए सेल का उपयोग करके एक कस्टम टेबल व्यू बनाने की कोशिश कर रहा हूं। मुझे एक अजीब त्रुटि मिल रही है:कस्टम UITableViewCell त्रुटि
<BroadcastViewController 0x4b4f5f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key postText.
सबकुछ सेल नियंत्रक को आईबी में सही तरीके से तारित किया जाता है। वास्तव में यह सुनिश्चित नहीं है कि यह क्यों हो रहा है।
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//Get the folder object of interest
Broadcast *messageAtIndex = [self.messages objectAtIndex:indexPath.row] ;
static NSString *CellIdentifier = @"BroadcastTableViewCell";
static NSString *CellNib = @"BroadcastTableViewCell";
BroadcastTableViewCell *cell = (BroadcastTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
//ERRORING ON THIS LINE...
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil];
cell = (BroadcastTableViewCell *)[nib objectAtIndex:0];
}
cell.postText.text = messageAtIndex.replyText;
cell.authorName.text = messageAtIndex.postCreatorFirstName;
cell.postDate.text = messageAtIndex.creationDate;
return cell;
}
किसी को भी करने से पहले त्रुटि इस तरह देखी गई:
इस तरह क्या मेरी cellForRowAtIndexPath लग रहा है? अगर आपको किसी और जानकारी की आवश्यकता है तो मुझे बताएं ...
फ़ंक्शन सेल के लिए पूर्ण कोड की आवश्यकता है ForRowAtIndexPath – SegFault
अपडेट किया गया है। – gabaum10
ऐसा लगता है कि आप किसी ऐसे चीज़ में 'postText' के लिए कोई मान डालने का प्रयास कर रहे हैं जो NSDictionary नहीं है? :) – willcodejavaforfood