Iphone 为什么我会得到一个“a”;冲突类型“;警告下面的实例方法?
我有下面的代码Iphone 为什么我会得到一个“a”;冲突类型“;警告下面的实例方法?,iphone,Iphone,我有下面的代码 - (UITableViewCell *)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { [[cell textLabel] setFont:[UIFont systemFontOfSize:10.0]]; return cell; } 由于某些原因,我得到以下错误: 警告:'-(UI
- (UITableViewCell *)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
[[cell textLabel] setFont:[UIFont systemFontOfSize:10.0]];
return cell;
}
由于某些原因,我得到以下错误:
警告:'-(UITableViewCell*)tableView:(UITableView*)tableView将显示cell:(UITableViewCell*)RowatineXpath的单元格:(NSIndexPath*)indexPath'的类型冲突
有人知道这是什么原因吗
- (void)tableView:(UITableView *)tableView
willDisplayCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath
根据苹果公司的说法,我想应该是无效的。你使用了错误的方法。使用
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
而不是你的。这样就不会显示警告了。;-) 该方法的返回类型应为
void
。该方法不返回单元格,而是simpoly通知您将显示该单元格。显示的特定单元格作为方法参数之一传递。你不需要退货。您可以设置字体,然后让它继续进行。-1因为没有考虑CellForRowatineXpath不是该询问者想要的方法。不幸的是,这不能解决我的问题。无法修改cellForRowAtIndexPath中的字体。查看此线程以了解更多信息:谢谢,此线程已修复它。愚蠢的我。:)