コンテナー ビューに (サブビューとして) 表示しようとしている PFQueryTableViewController のサブクラスがあります。私の問題は、カスタム セルをテーブルビューに表示できないことです。デバッグで次のことを確認しました。
- テーブルビューが親ビューに追加されています
- テーブルビューは、更新するためのデフォルトのプルが含まれているため、PFQueryTableView コントローラーです。
- PFQuery が正しい数のオブジェクトを返している
- CellForRowAtIndexPath メソッドが呼び出され、正しい回数反復処理されています。
- Parse からの正しいデータが、セル内のさまざまなラベルに渡されています。
- ラベルは、UITableViewCell のサブクラスで IBOulets を介して接続されます。ラベルにアクセスしようとすると、サブクラスとラベルにアクセスするため、正しく機能しています
セルが実際に表示されることを除いて、ここですべてが正しく機能しています。私は何が欠けていますか?
これは私の cellForRowAtIndexPath コードです:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object{
static NSString *CellIdentifier = @"RoundCell";
RoundCell* cell = [tableView dequeueReusableCellWithIdentifier: CellIdentifier];
if (cell == nil)
{
cell = [[RoundCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// get string values from Parse
NSString * teeString =[object objectForKey:@"roundTee"];
NSString* courseString = [object objectForKey:@"roundCourse"];
NSString * courseString2 = [[courseString stringByAppendingString:@" - "]stringByAppendingString:teeString];
NSString * dateString = [object objectForKey:@"roundDate"];
NSString * scoreString = [object objectForKey:@"roundScore"];
NSString * differentialString = [object objectForKey:@"roundDifferential"];
cell.courseNameCell.text = courseString2;
cell.dateCell.text = dateString;
cell.scoreCell.text= scoreString;
cell.differentialCell.text=differentialString;
return cell;
}