I agree with Chuck and commenters. Your method is dependent on too many other objects, but putting hasPickedName:
on pickerViewController
means pickerViewController
still has to do [picker.bvc.currentResolve.name isEqualToString:message]
somehow.
Instead, you could put hasPickedName:
on bvc
and inject bvc
as a delegate (typed id<NamePickerDelegate>
maybe) into your top-level object using Interface Builder. To be truly Demeter-compliant, make currentResolve
grow a method nameMatches:
that shortcuts [currentResolve.name isEqualToString:message]
.
You should look carefully at the complexity caused by the problem verses the complexity that would be introduced by each solution. If you judge that the original code is simpler and easier to maintain than the alternatives, keep it.