以下のエラーを理解して修正するのを手伝っていただけますか。CustomCellView
が のサブクラスであることがわかりませんUItableViewCell
。コードはコンパイルされますが、警告はまだ表示されます。
Incompatible pointer type initializing 'CustomCellView *' with an expression of type `UItableViewCell`
以下の 2 行目がハイライトされました:
static NSString *CellIdentifier = @"CustomCell";
CustomCellView *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
ベストアンサー1
static NSString *CellIdentifier = @"CustomCell";
CustomCellView *cell =(CustomCellView*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
セルにキャストする必要があります