I really have almost no idea how I can even begin to do this so I’ll just explain it. I have a custom view that holds another, smaller view. Those two views are entirely built in IB, the main one has several input fields and will only resize (which I think I’ve got pretty much down). The second one appears after the input in the main one has been set. To be clear, the first one only asks for some inputs, once is has them, the second view appears and starts using those input values. What I would like to do is to be able to put some inputs first, and have the second view appear, then put in some other inputs, and have another view (that looks the same as the first one) appear, but instead use the new input values.
What I want to know is if I have to make the same custom view in IB several times, or (how I think it might be done) to make the second view sort of a separate class, and have a new object created for each new input and, from another class, control how they’re positioned in the main view. If that is the way it’s done I’d like some help because I really do not know how to programmatically make a new object, or do any of these things. The program would have to understand that the views are entirely separate, and for each command (such as cancel) to be applied to only one of the views.
I realize this is very broad but I don’t have any experience at all with this particular problem. I basically have a custom view that takes some input, and would like for the view to repeat itself each time inputs are sent, but for each view to be independent of one another.
Thanks for the help.
You can load interface files more than once. To do this you can use
UINibdirectly,UIViewController, orNSBundle, to name a few methods. It may help to set the nib’s owner when you instantiate it — this object will be accessible for connections via “File’s Owner” in the nib. Also keep in mind that you could reconfigure the same view and use it more than once. With some more information we might be able to provide some more helpful suggestions.