For every IBOutlet that you need to manage you need to have a pointer, so also need to have a property. Most of the time property needs to be synthesized, then released both in deallloc and viewDidUnload. So actually, there is a little bunch of code that you need to write repeatedly. What you get for that is ease to use and clarity in the code. Now, using and accessing objects from IB with [self.view viewWithTag:] saves a little bit code space but gives a little bit unclarity because you need to remember or to check IB for object tags. So, why does anyone would bother using viewWithTag?
Share
In my case, I occasionally need to add buttons dynamically to views, and need to know which one has been pressed, or recall the other buttons.
So that I can do:
I use to declare the button type (or any view type) in enum so that I can safely assign and recall later: