我仍然在iOS開發有點綠,不斷得到那我不知道有關的警告。不兼容的指針類型的警告
我使用一個tableview中自定義單元格,並設置其類是的UITableViewCell的子類,稱爲SiteCell。在我的「didSelectRowAtIndexPath方法」的方法,當我聲明所選擇的小區作爲SiteCell類型,收到以下警告:
不相容指針類型初始化SiteCell與類型的 表達__strong的UITableViewCell
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
SiteCell *cell = [tableView cellForRowAtIndexPath:indexPath];
NSString *rowIdentity = [NSString stringWithFormat:@"%d", indexPath.row];
[selectedRows setObject:[cell.siteTitleLabel text] forKey:rowIdentity];
if(cell.accessoryType == UITableViewCellAccessoryCheckmark){
cell.accessoryType = UITableViewCellAccessoryNone;
}else{
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
}
任何人都可以闡明如何擺脫這一警告的任何輕?
當然!謝謝 – Pheepster 2013-04-04 18:26:06