Pouvez-vous m'aider à comprendre et corriger l'erreur ci-dessous? Je ne comprends pas car CustomCellView
est une sous-class de UItableViewCell
. Le code est compilé mais l'avertissement est toujours là:
Incompatible pointer type initializing 'CustomCellView *' with an expression of type `UItableViewCell`
J'ai eu la 2ème ligne ci-dessous éclairée:
static NSSsortingng *CellIdentifier = @"CustomCell"; CustomCellView *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
static NSSsortingng *CellIdentifier = @"CustomCell"; CustomCellView *cell =(CustomCellView*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
vous devez taper cast dans votre cellule
static NSSsortingng *CellIdentifier = @"CustomCell"; CustomCellView *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
Pour la cellule personnalisée ci-dessous le code fonctionne également très bien avec une trame donnée.
CustomCell *cell= [[[CustomCell alloc] initWithFrame:CGRectZero reuseIdentifier:nil] autorelease];