If I have some objects like UILabel, UIImageView, etc. on my XIB
But I don’t using any IBOutlet to connect them
I reference these objects like follow
UILabel *label = (UILabel *)[[self.view subviews] objectAtIndex:x];
UIImageView *imageView = (UIImageView *)[[self.view subviews] objectAtIndex:x];
Do I need release this objects?
No. If you don’t call retain on it, then you don’t have to release it.
However, your approach is very bad. Is any reason that stop your from creating IBOutlet connection? Even use
viewWithTag:will do a better job. Because if you add a new view to nib, it is very likely to mess the order and you have to change every hardcoded index value.