About dequeueReusableCellWithIdentifier:

蓝咒 提交于 2020-01-07 04:25:29

问题


Case 1: create UITableViewCell with

initWithStyle:reuseIdentifier:

Case 2: create UITableViewCell with

[[NSBundle mainBundle] loadNibNamed:@"MyCell" 
                             owner:self options:nil];

Case 1 will create reusable cell combined together with specific identifier,which will be pushed into the reusable queue.

Case 2 will create one cell from nib file, but can not be put into the reusable queue as case 1.

Question is

any solution for case 2 to make the cell be reusable ?


回答1:


In the XIB there is a setting for the UITableViewCell to set its reuse identifier. If you set it there, you can retrieve it as normal from the dequeue method.



来源:https://stackoverflow.com/questions/5945010/about-dequeuereusablecellwithidentifier

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!