Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uncategorized Compilation Failed error in iOS5 Storyboard

I got a very strange error when compiling my app, it's just like in the picture below, anyone knows what's going on?

enter image description here

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>
like image 453
oratis Avatar asked May 10 '12 04:05

oratis


2 Answers

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

like image 84
Rikkles Avatar answered Sep 21 '22 11:09

Rikkles


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;
}
like image 25
user589642 Avatar answered Sep 22 '22 11:09

user589642