I have a viewcontroller, that contains many custom UIViews. The custom UIView I tried to define it using InterfaceBuilder (IB), and load it within initWithFrame using this code:
NSArray *xib=[[NSBundle mainBundle] loadNibNamed:@"DayView" owner:self options:nil];
The view controller behaved extremely slow, so I decided to try to load the items of the custom uiview programatically. VĂ²ila, and the speed was increased by a factor of about 7.
How come the difference between loading XIB files and using "clean" code is so big? My first hypothesis that I could think of was that IB is setting a lot of properties by default, whereas they simply are nil when defining them in code. But it cannot explain the huge performance difference! I haven't found any posts that explicitly warn you against using IB of performance reasons.
EDIT: I just found this link and therefore this blogpost which explains interesting things about when xib files are loaded from disc. I guess that loading from disc explains the difference. /K