Domanda

I have xib file.

In this xib I would like to create a lot of Cell for My App.

I have the same Left part in UITableViewCell, but right is different.

How I Can inheritance One Cell from another Cell, if both UITableViewCell load from nib (one Nib or different)?

enter image description here

Thank you

È stato utile?

Soluzione

There is no concept of inheritance among NIB files. Your only option is to duplicate the original file and make the necessary changes.

Generally speaking, I use XIBs to layout the custom cell, set the class of the cell in the XIB to my custom class and go from there with it's implementation file.

However it's not possible (to my knowledge) to have a base XIB with you inherit from.

I think the cleanest approach would be to have a separate XIB for each Cell you design.On the implementation side, where you define the class files, you can use inheritance there.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top