I have to agree with aoberoi .. the delegate was used correctly just that when you link a view to data you are making it less reusable. Apple states controllers should be the non reusable part of your program so you should separate a view from a views data, doing so will in turn (hopefully) make your view classes and model classes reusable.
Quote:
Originally Posted by aoberoi
Oh I agree completely that the application delegate is implemented correctly.
My difference of opinion (and thats all it is) is where the methods such as sayHi and tellDelegateToFlipView should be implemented. I think there should be outlets for these methods in View Controller classes. These classes are typically implement the functionality of items placed in the Views. To communicate with data used by the whole application, yes it makes sense to go to the app delegate.
In this small example, an easy to understand method does have its obvious advantage. I am only commenting that in order to use the principles of the design pattern, technically the functionality of those buttons should be moved to a view controller. Otherwise, one might ask, why did I have to make a class file for the view controllers? I never used them right? Also, if it was implemented the way I suggested, there would be no need to make source files for either of the Views, and less source files to me means easier to understand.
|