Can someone explain me the way reusable cells works for single table view?
How many reusable cells a datasource should create? So far in all samples I’ve seen only one. Would one even need more?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When creating a cell, you pass an identifier for that specific type of cell, so that later, you can try to get a preallocated one and only need to recreate one, if there is not a free one left (done automatically for you – just try to get one with the identifier as in the example code).
You can use as many different identifiers as you like, good practice is to use a different one for every different type of cell (which are probably of different UITableViewCell subclasses anyway).
So if you have CellTypeA and CellTypeB (both inheriting from UITableViewCell or setup very differently), use distinct keys for both types.