He visto casi todas las preguntas relacionadas sobre esto aquí en stackoverflow y he intentado con todas sus posibles soluciones, pero todavía no puedo entender por qué obtengo este error:Subclase UITableViewCell personalizada: esta clase no es un valor clave que cumple con la codificación
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<CustomCell 0x6e627d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key title.'
estoy tratando de cargar una célula vista de tabla personalizada con el nibname: @ "CustomCell". Su clase está asignada a "CustomCell" (el mismo nombre de clase que el nombre de punta). El propietario del archivo también está configurado para la clase que carga estas celdas: "ProductsTableViewControllerWithSearch". Todos los puntos de venta en la punta están conectadas a las de CustomCell.m
Aquí está mi código:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellClassName = @"CustomCell";
static NSString *CellIdentifier = @"Custom Items Cell";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *topLevelItems = [[UINib nibWithNibName:CellClassName bundle:[NSBundle mainBundle]] instantiateWithOwner:self options:nil];
cell = [topLevelItems objectAtIndex:0];
}
//... more irrelevant code here
}
Puede alguien me ayude por favor. He estado trabajando en esto por más de 4 horas. ¡Muchas gracias!
PS: Estoy usando ARC y estoy desarrollando para iOS 5.
Aquí está mi CustomCell.h.
#import <UIKit/UIKit.h>
@interface CustomCell : UITableViewCell{
UILabel *textLabel;
UILabel *detailTextLabel;
UIButton *starButton;
}
@property (strong, nonatomic) IBOutlet UILabel *textLabel;
@property (strong, nonatomic) IBOutlet UILabel *detailTextLabel;
@property (strong, nonatomic) IBOutlet UIButton *starButton;
@end
No hay nada en mi CustomCell.m
Lo que es una subclase de CustomCell? – JoePasq
@JoePasq UITableViewCell. – acecapades