In general, their recommendations for โcontainingโ a view controller when one contains the other should be followed to determine if you need to implement containment.
In particular, worrying about adding the same child view controller twice is to worry about presenting the same view controller twice. If you really thought through everything, you do not have to face this problem. Your guess is correct.
I agree that Apple docs need to be more proactive about what happens to strange parameters or when they fail, but there may also be a case where you donโt want to get attached to fixing errors, which can cause problems along the way. When you develop a design that never calls these methods differently, you solve the problem correctly and donโt depend on any mistake that they may or may not have - more importantly, if you consider this to be a fix Bugs may work differently in the future, disrupting your application.
Walking a little more, you will notice that Apple container view controllers cannot fall into an invalid state (at least not easily with an open API). Using the UITabViewController switching from one view controller to another is an atomic operation, and the tab display controller knows exactly what is happening at any time. The most you need to do is remove the active and show a new one. The only time he blows everything out of the water is when you say "you have to blow everything out of the water and start using these view controllers."
Encoding anything else, such as deleting all views or all view controllers, regardless of what may seem appropriate or reliable in some cases, but this is exactly the opposite, since in fact one end of your code does not trust the other end of yours to keep its part of the deal. In any situation where this actually helps you, it means that you have allowed people to add per-view controllers perforce without the control that you should wish, in which case this is a problem that you need to fix.
Jesper
source share