[MonoTouch] Startup times: nib vs. nib-less [was Re: Can I show splash image within a second?]
Ed Anuff
ed at anuff.com
Tue Nov 24 20:48:06 EST 2009
I believe that the overhead of NIB's doesn't come from the loading of the
NIB file itself. As you point out, it's compiled to a binary file. If
using NIBs actually had a lot of inherent overhead, it would be trivial to
create a tool like the MonoDevelop code-behind to compile them to C# code
that you could hand edit (which actually, would be pretty useful). I think
that the issue is the lazy instantiation of views loaded from NIBs isn't all
that lazy and always ends up instantiating more than you probably need at
startup. You can see this if you put logging code in your viewDidLoad
methods. Now, one approach is to break your UI into multiple XIBs.
However, if you're using a UITabBarController as your main controller, which
isn't all that uncommon, you're going to find that nothing works quite as
expected, which is why most people recommend against it. If you're coding
things by hand, you're probably only going to get the benefits if you do a
lot of UI construction in your viewWillAppear methods. However, I'd take
any recommendations along these lines with a grain of salt and test any
approach empirically.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20091124/c2881de2/attachment.html
More information about the MonoTouch
mailing list