[MonoTouch] Can I show splash image within a second?
akihiro uehara
rupppau at gmail.com
Mon Nov 23 06:39:28 EST 2009
Thank you,
Following your advices, I've decided not to use XIB.
I have compared view class instance loading time you pointed out. (
test results are reported in my blog entry (sorry it is in
japanese...) http://d.hatena.ne.jp/feb-hare/20091111/1257905293 )
Xib loading time is about twice as much as coded one takes (30msec vs
15msec), even a view has only one label.
By the way, I've noticed that I have to write application delegate
class to hold a UIWindow class instance in a field variable, as
following:
public class someDelegate: UIApplicationDelegate
{
UIWindow _window;
public override bool FinishedLaunching(UIApplication app,
NSDictionary options)
{
_window = new UIWindow(UIScreen.MainScreen.Bounds);
....
}
}
When I write the following code, screen suddenly blacks out after a few minutes:
public class someDelegate: UIApplicationDelegate
{
public override bool FinishedLaunching(UIApplication app,
NSDictionary options)
{
var win = new UIWindow(UIScreen.MainScreen.Bounds);
....
}
}
I can not figure out why, but I may guess that the UIWindow instance
is garbage collected.
2009/11/23 Rory Blyth <lists at rory.me>:
> I saw that your question was answered, but one way to increase startup
> performance for *any* iPhone app is to either:
>
> 1) Code part or all of the UI by hand. It takes time to load NIBs.
>
> 2) If you're using XIBs, don't put the entire UI for your app inside a
> single XIB - break it up logically. For example, if you have an "About"
> screen, it's something most users aren't ever going to care about. But if
> you stick it in that MainWindow.xib file, it's going to become overhead at
> *startup*.
>
> At most, *if* I use XIBs, I'll use MainWindow *only* to lay out tab or nav
> controllers (I'd rather build the beginnings of that hierarchy with a tool
> than code it, though coding it really isn't that bad).
>
> It's a common n0ob error to stuff everything you can manage inside a single
> XIB (with MT, I assume devs tend to overdo it with MainWindow), and that
> stuff has to be unarchived at runtime - the more there is to slog through at
> startup, the slower your app is going to... well, start.
>
> For an experiment, try going XIBless, or minimizing what's in your
> MainWindow.xib, loading new NIBs only when *necessary* (sorry for the
> confusing switches in terminology - a NIB is a binary XIB, and it's what's
> going to end up in your app bundle).
>
> This will also decrease strain on memory, which is a big issue on the
> iPhone.
>
> Hope this helps :)
>
> - Rory
> - Sent from my iPhone
>
> On Nov 12, 2009, at 10:43 PM, akihiro uehara <rupppau at gmail.com> wrote:
>
>> Hi,
>>
>> I'm wondering how I can show a splash image and a waiting cursor
>> within a second on a device.
>> On my test device (iPod touch 1st Gen. OS 3.1.2), even a simple hello
>> world app (release build) takes about 2 seconds until some views are
>> on a screen.
>>
>> I want to show a splash image and a waiting cursor instead of the
>> black screen. To accomplish this, I think that I should write main and
>> application delegate class in objective-c to show a splash image and
>> then call a method written in monotouch.
>>
>> Well, Is there any way to connect objective-c boot class to C# classes ?
>> Or is there any way to avoid start-up black screen ?
>> _______________________________________________
>> MonoTouch mailing list
>> MonoTouch at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
More information about the MonoTouch
mailing list