I have a for loop which calls a class method in another class where a UIAlertView popup will trigger under certain conditions. I want to escape the loop if the popup was shown. What is the usual tactic for implementing this type of communication?
Share
I think it’s possible to find some way to detect if some UIAlertView is exposed now.
But it’s not very good. Programs build in such way may fall apart with minor changes in frameworks guts. You need some connection between objects.
1. Use delegation pattern. It’s the best way.
2. If connections between objects are too complex or unpredictable which makes difficult usage of delegation, use notifications pattern (read about NSNotificationCenter class).