尝试在表视图中显示数组时出错

时间:2012-09-18 20:50:36

标签: ios xcode arrays tableview

到目前为止,我已将此添加到我的firstviewcontroller.h文件中:

@property (strong, nonatomic) IBOutletCollection(UITableViewCell) NSArray *testcell; 

然后我在.m文件中更改我对.h文件所建立的连接名称时添加了您的示例,如下所示:

NSLog(@"Currrent listeners on mount OrienLive = %@", listeners3);
NSLog(@"Fourth mount point = %@", mountPoint4);
NSLog(@"Currrent Song playing on mount Rock = %@", currentSong4);
NSLog(@"Currrent listeners on mount Rock = %@", listeners4);
}
- (UITableViewCell *)testcell:(UITableView *)testcell cellForRowAtIndexPath:(NSIndexPath      *)indexPath {
//.. after initial setup
NSInteger position = indexPath.row * 6;
cell.mountLabel.text = [self.mountArray objectAtIndex:position + 11];
cell.songLabel.text = [self.mountArray objectAtIndex:position + 16];
cell.listenerLabel.text = [self.mountArray objectAtIndex:position + 14];
//.. continue with other setup
}

我得到的错误是“ - (UITableViewCell *)testcell”部分错误是:

无效的参数类型“UITableViewCell”

其他错误=使用未定义的标识符“indexPath”

0 个答案:

没有答案