[MonoTouch] iOS 5 MainWindow.xib help needed

steve rennocks steve at srennocks.freeserve.co.uk
Tue Oct 18 09:49:19 EDT 2011


Hi Michael,

Many thanks for your detailed reply.  I agree, the new way is a definite
improvement and the storyboard feature looks fantastic.  My issue turned out
to be that I didn't have 'MainWindow' specified in Info.plist as the initial
XIB.  Well I did, but I'd got also got pre-build commands that were
overwriting the Info.plist with different configurations for my FullFat &
Lite versions of the app.   So Info.plist didn't contain the values I
thought it did.

This also explained why I was losing other settings that I was certain I'd
configured in the new info.plist properties screen.  

So my own fault, but because iOS 5 has caused quite a few things to break in
my app I assumed it was related to iOS 5 support in MonoTouch.

Cheers,

Steve



-----Original Message-----
From: Michael Hutchinson [mailto:mhutch at xamarin.com] 
Sent: 18 October 2011 10:10
To: Jeff Stedfast
Cc: MonkeyWorld; monotouch at lists.ximian.com
Subject: Re: [MonoTouch] iOS 5 MainWindow.xib help needed


You can use a MainWindow.xib you want to, we just changed the pattern
that the templates use. The difference is in how the AppDelegate is
created.

In the old templates, Main would call
UIApplication.Main (args);
which loads the main xib as specified in the Info.plist, and
instantiates the custom objects in it, which must include the app
delegate. Of course, that xib can create other objects too and connect
them to the app delegate, such as a window, views, view controllers,
etc.

In the new templates, we call
UIApplication.Main (args, null, "AppDelegate");
which doesn't use a main xib, instead it initializes the application
directly using a new instance of the "AppDelegate" app delegate. Then,
that app delegate's FInishedLaunching would typically create the
window and load the views, controller, etc, most likely from xibs or
storyboards.

There's nothing to stop you doing the old way if you prefer it, we
just don't have templates for it, since the new way is somewhat easier
to follow for new users, and doesn't mandate the use of Interface
Builder.

-- Michael

On Fri, Oct 14, 2011 at 3:49 PM, Jeff Stedfast <jeff at xamarin.com> wrote:
> Hi MonkeyWorld,
>
> I am Cc'ing Michael Hutchinson who is probably the best person to
> answer your question. I believe that he is on vacation until mid-next
> week, but he may respond sooner if he checks his email in the
> meantime.
>
> Jeff
>
> On Thu, Oct 13, 2011 at 5:15 PM, MonkeyWorld <steve at rennocks.co.uk> wrote:
>> Downloaded iOS 5 sdk + mono develop 2.8 and MT 5.0 today and struggling
with
>> getting my app to start up now.  MainWindow.xib no longer auto created
and
>> while I can take my controllers out of my main window.xib I'd prefer to
>> leave as is.
>>
>> Anyone had trouble with lack of MainWindow.xib and also need to create
>> RootViewController in FinishedLaunching - I'm a bit stumped by the
>> differences at moment as got so much of my initial interface in
>> MainWindow.xib
>>
>> So is there a way to force it to load and react much as per iOS 4 ??
>>
>> Cheers
>>
>> --
>> View this message in context:
http://monotouch.2284126.n4.nabble.com/iOS-5-MainWindow-xib-help-needed-tp39
02962p3902962.html
>> Sent from the MonoTouch mailing list archive at Nabble.com.
>> _______________________________________________
>> MonoTouch mailing list
>> MonoTouch at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>>
>





More information about the MonoTouch mailing list