It's been awhile since I looked at this, but tab bar controllers (selectedViewController), navigation controllers (topViewController), and child controllers are probably going to cause your current method some difficulties.
A navigation controller presenting a tab bar controller presenting a navigation controller with a child controller presenting a tab bar controller… on an iPad. Or any set of permutations of those.