我在iOS 5中收到此错误
-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0xa217200
但是,我在iOS 6中没有错误.我该如何解决这个问题?这是我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"MyCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; /// SIGABRT error
if (!cell)
{
cell = [[UITableViewCell alloc]
initWithStyle: UITableViewCellStyleSubtitle
reuseIdentifier: CellIdentifier];
}
return cell;
}
Run Code Online (Sandbox Code Playgroud)