dequeueReusableCellWithIdentifier error in my UITableView in iOS5

前端 未结 2 2092
误落风尘
误落风尘 2020-12-23 13:49

I am getting this error in iOS 5

-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized selector sent to instance 0xa217200

2条回答
  •  星月不相逢
    2020-12-23 14:19

    EDIT: This method is newly added in iOS6+ SDK.

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
    

    But in iOS 5, to create instance of UITableViewCell we generally use this method :-

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    

    In iOS 5, there is no need of extra parameter which you have used in iOS 6. (forIndexPath:).

    So change your method. It will work.

提交回复
热议问题