今天在学习IAP的时候无意间看到原来 tableView: cellForRowAtIndexPath:方法中有两个获得重用cell的方法,一直以来都是用UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];那下面的这个怎么用呢,感觉比较怪,假设没有重用的岂不是为空了UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]具体有什么区别呢,并且当我用 UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]的时候,为什么总报错reason:
'unable
to
dequeue
a
cell
with
identifier
Cell
-
must
register
a
nib
or
a
class
for
the
identifier
or
connect
a
prototype
cell
in
a
storyboard',经过查阅,知道原来此方法为6.0新加的,在SDK5.0是运行不起来的。
如果需要使用这个方法,你必须使用配套的方法来一起用,下面两个配套方法选其一: