I got a very strange error when compiling my app, it's just like in the picture below, anyone knows what's going on?
Errors in log:
error: Compilation Failed.
Underlying Errors: Description: Couldn't compile connection: <IBCocoaTouchOutletConnection:0x400d6f420 <IBProxyObject:0x400d6e080> => nameShow => <IBUILabel: 0x400c7e0c0> Description: Couldn't compile connection: <IBCocoaTouchOutletConnection:0x400d71200 <IBProxyObject:0x400d6e080> => catShow => <IBUILabel: 0x400bf9280> Description: Couldn't compile connection: <IBCocoaTouchOutletConnection:0x400d6ffc0 <IBProxyObject:0x400d6e080> => numShow => <IBUILabel: 0x400be0380>
The problem is that you've got IBOutlets that link to prototype cells. Note that prototype cells are just that: prototypes. So you can have multiple instances of each. Therefore Xcode won't know which instance to link the IBOutlet variable to.
You'll have to wait until the cells are instantiated inside cellForRowAtIndexPath to assign the properties
This may help. The key is that you need to set the Tag values in IB for your Storyboard outlets.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[UITableViewCell alloc] init];
cell = [tableView dequeueReusableCellWithIdentifier:@"LogRecordCell"];
cmiJournal = (CMIJournal *)[fetchedResultsController objectAtIndexPath:indexPath];
UILabel *useJName = (UILabel *)[cell.contentView viewWithTag:101];
UILabel *useJTime = (UILabel *)[cell.contentView viewWithTag:102];
UITextView *useJRecord = (UITextView *)[cell.contentView viewWithTag:103];
useJName.text = cmiJournal.cmiJournalName;
useJTime.text = fnlDate;
useJRecord.text = cmiJournal.cmiJournalRecord;
return cell;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With