【发布时间】:2014-09-28 18:01:11
【问题描述】:
我正在处理这段代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:CGRectZero reuseIdentifier:nil] autorelease];
}
//cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
并首先替换
initWithFrame:
与
initWithStyle:
上面,因为我收到了initWithFrame:reuseIdentifier deprecated 错误。
但是,现在我遇到了一个新错误:
Sending 'const CGRect' (aka 'const struct CGRect') to parameter of incompatible type 'UITableViewCellStyle' (aka 'enum UITableViewCellStyle').
此错误专门指向上面initWithStyle:CGRectZero 中的CGRectZero。
我已经搜索过,但无法弄清楚这一点。有谁知道如何解决这个问题?
提前致谢! :)
【问题讨论】:
-
您是否真的阅读过错误信息并试图理解它???? (你看过 UITableViewCell 的文档了吗????)
标签: ios objective-c uitableview