There is nothing wrong with the code, apart from being difficult to read (and therefore to maintain), however you will need to add some checks to see if the view you think is a UITextField
is in fact one:
UITextField *textField = [[childViewController view] viewWithTag:0];
NSAssert([textField isKindOfClass:[UITextField class]], @"Oh no! I was wrong");
NSString *text = textField.text;
I would suggest tag 0
is a bad number to choose as that's the default (unset) value and I would expect that assert to fire.