I have a device/debug build that works fine. When I build for release and distribute onto the device, I get this error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UILabel setWidth:]: unrecognized selector sent to instance 0x1605a0'
It is occurring in cellForRowAtIndexPath:
cell.videoName.width = 163.0;
where cell is a custom UITableViewCell and videoName is a UILabel. Why would the debug build work fine and release fail? Distribution build also fails. All are set for Base SDK == iPhone OS 3.0.
To get a release build onto the phone, I'm simply changing my code signing to developer. I've also tried the distribution build through iTunes but it fails with the same error.
--- edit ---
I'm loading the cell like this:
static NSString * QuestionCellIdentifier = @"QuestionCellIdentifier";
TopicCellController *cell = (TopicCellController *)[tableView dequeueReusableCellWithIdentifier:QuestionCellIdentifier];
if(cell == nil){
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"TopicCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
cell.videoName.width = 163.0;
At runtime, the cell is of the custom type and videoName isn't nil. If I remove the last line (setting width), it works fine.
--- Edit: new discovery ---
I have found that rather than calling width, I can do this and it works in release:
cell.videoName.frame = CGRectMake(10, 10, 100, 30);
That really doesn't make any sense.