Incompatible Xcode Pointer Types

Sorry I'm on this burden, but I'm really stuck here.

Semantic Problem: Incompatible Pointer Types Initializing with a NewCustomCell *Type ExpressionUITableViewCell *

static NSString *cellID = @"customCell";

NewCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
+5
source share
2 answers

[tableView dequeueReusableCellWithIdentifier:cellID]returns an object with a type UITableViewCell *. If you know that a cell will always have a type NewCustomCell *, then you can tell the compiler that it expects it to be executed. For instance:

NewCustomCell *cell = (NewCustomCell *) [tableView dequeueReusableCellWithIdentifier:cellID];
+12
source

You have to drop it.

NewCustomCell *cell = (NewCustomCell *)[tableView dequeueReusableCellWithIdentifier:cellID];
+3
source

All Articles