Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incompatible pointer type initializing 'CustomCellView *' with an expression of type UItableViewCell

Tags:

Can you help me understandand/fix the error below. I don't understand as CustomCellView is a subclass of UItableViewCell. The code gets compiled but the warning is still there:

Incompatible pointer type initializing 'CustomCellView *' with an expression of type `UItableViewCell`

I got the 2nd line below hightlighted:

static NSString *CellIdentifier = @"CustomCell";
CustomCellView *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
like image 555
Steve Avatar asked Sep 10 '11 15:09

Steve


1 Answers

static NSString *CellIdentifier = @"CustomCell";
CustomCellView *cell =(CustomCellView*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

you need to type cast to your cell

like image 188
Praveen-K Avatar answered Oct 02 '22 16:10

Praveen-K