Multiple custom cell types per table UITableView (iPhone)?

Simply, if it works for you then go for it. All of these ideas are viable solutions Personally, I'd go for them in this order : 2, 1, 4, 3. Though that's just my personal preference PS None of these ideas are going to get your app rejected by Apple.

Simply, if it works for you then go for it. All of these ideas are viable solutions. Personally, I'd go for them in this order : 2, 1, 4, 3.

Though that's just my personal preference. PS None of these ideas are going to get your app rejected by Apple.

I have found that option #2, a custom cell class with a separate XIB, is the easiest to maintain. Creating everything in the code will run faster, but when I'm developing, it takes more time/effort to get into the flow of modifying the code. In the end, ease of maintenance is more important than a minor hit in performance.

I don't see any downside to this approach. Visually it is nice having the cells in XIBs if they have any complexity in their layout. I agree with the OPs assessment that #4 smells like a hack.

– Stephen Petschulat Jul 7 at 18:33.

I don't see any drawbacks for your method 4, which is a variant of method 2 (using just one xib for all cells instead of one for each of them). I don't see any need for defining the cell programmatically, nor to bloat the xib associated to your main view controller with all the custom cells (that you could reuse elsewhere). Implementing option 2 or 4 does not entail a big difference.

With option 2 you load the nibs one by one, with option 4 you load the unique nib, then manage the array of objects (views/cells in your case) that you get.

Basically what I'm looking to do is how to represent more than one customized cell type in a table. Also, there are other tables in the app that will potentially reuse some customized cells. Most of the time, tables will have the same cell type repeated over and over.

But in a few cases, I have a table with a couple types of complex custom cells. Listed below are the different ways I've learned you can do this. I've tried each one and they all work but I'm unsure of the "proper" way and a way that Apple won't reject.

Simply, if it works for you then go for it. All of these ideas are viable solutions.

I have found that option #2, a custom cell class with a separate XIB, is the easiest to maintain.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions