I have an interface that allows users to select a type of childObject. These objects all inherit from the same parentObject. Is there a way to dynamically generate this list of childObjects given a parentObject? Currently, when I create a new child, I then have to add it to the TVC’s list of children to display.
Edit:
Here’s an example:
Class A (child of NSObject)
->Class A1 (child of Class A)
->Class A2 (child of Class A)
I’d like to ask Class A: “What are your children?”
You can use reflection:
Here ‘children’ will contain the descandants of
parent.