En CustomCell.m Defino el método init donde quiero cargar la celda del IB:Volviendo 'self' mientras no está configurado para el resultado de '[(super o self) init ...]' cuando inicializo la celda personalizada
- (id)init {
self = [super init];
if (self) {
NSArray *nib =[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
self = [nib objectAtIndex:0];
}
return self;
}
en el MyTableViewController.m en el cellForRowAtIndexPath método que inicializar mi celda personalizado
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
cell=[[CustomCell alloc]init];
return cell;
}
Todo funciona como esperaba, pero cuando lo hice me Product -> Analyse
obtener
Returning 'self' while it is not set to the result of '[(super or self) init...]'
¿Qué estoy haciendo mal?
Gracias, pero antes cell = [CustomCell newCell]; ¿Necesito la célula de inicio: célula = [[CustomCell alloc] init]; – Alex
¡Hice como usted explicó, y ahora tengo esto! en lugar de la anterior: El objeto con +0 retendrá los conteos devueltos a la persona que llama donde se espera un recuento de retención +1 (propietario) – Alex
Oh sí, lo llamé newCell de lo que ARC se quejará. Actualizaré la respuesta, lo siento. – jrturton