试图在谷歌和stackoverflow上搜索答案但卡住了。我正在使用https://parse.com/docs/ios/api/Classes/PFQueryTableViewController.html 用我的对象填充数据。 一切似乎都很好我得到了这个表格视图的正确数据
但我想使用我的故事板单元,但这似乎我做了错误的初始化。
- (id)initWithPhoto:(PFObject *)aPhoto {
// self = [super initWithStyle:UITableViewStylePlain];
//self = [super init];
self = [super initWithClassName:@"photo"];
if (self) {
// The className to query on
self.parseClassName = kPAPActivityClassKey;
// Whether the built-in pull-to-refresh is enabled
self.pullToRefreshEnabled = YES;
// Whether the built-in pagination is enabled
self.paginationEnabled = YES;
// The number of comments to show per page
// self.obcojectsPerPage = 30;
self.photo = aPhoto;
self.likersQueryInProgress = NO;
}
return self;
}
这是 cellForRowAtIndexPath 的代码
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
object:(PFObject *)object {
[self.tableView registerClass:[KNPhotoDetailsCommentCell class] forCellReuseIdentifier:@"cell"];
static NSString *cellIdent = @"cell";
KNPhotoDetailsCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdent];
PFFile *userPhoto = userObject[@"profilePictureSmall"];
[cell.userPhoto setFile:userPhoto];
[cell.userPhoto loadInBackground];
[cell.imageView setFile:userPhoto];
[cell.imageView loadInBackground];
[self configureBasicCell:cell atIndexPath:indexPath];
NSString *userComment = object[@"content"];
cell.userComment.text = userComment;
cell.textLabel.text = userComment;
return cell;
}
请帮我实现如何显示我的单元格