На этот вопрос уже есть ответ здесь:
2010-09-21 15:03:11.562 Stocks[5605:207] *** Terminating app due to uncaught
exception 'NSUnknownKeyException', reason: '[
setValue:forUndefinedKey:]: this class is not key value coding-compliant
for the key actionText.'
Здесь мой код:
#import
#import
@interface AlertCell : UITableViewCell {
IBOutlet UILabel *actionText;
}
@property (retain, nonatomic) UILabel *actionText;
@end
И
@implementation AlertCell
@synthesize actionText;
- (void)dealloc {
[actionText release];
[super dealloc];
}
@end
Проблема возникает именно здесь:
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
AlertCell *cell =
(AlertCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AlertCell"
owner:nil
options:nil];
for (id oneObject in nib) {
if ([oneObject isKindOfClass:[UITableViewCell class]]) {
cell = (AlertCell *)oneObject;
break;
}
}
}
cell.actionText.text = [arrayAlert objectAtIndex:indexPath.row];
return cell;
}
В этой строке:
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AlertCell"
owner:nil
options:nil];
Как и просили, вот мой заголовок TableViewCOntroller:
#import
@interface AlertesViewController : UITableViewController {
NSMutableArray *arrayAlert;
}
И вы можете увидеть мой файл XIB (как XML): http://pastebin.com/FDVzLYZu
@end
Кто-нибудь может мне помочь? Большое спасибо!