Hi,

I'm a little confused about how this code works:

MyController *myController = [[ myController alloc ] initWithNibName: @"myView" bundle: nil ]; [[ self navigationController ] pushViewController: myController animated: YES ];
        myController.myProperty = itsValue;
        [ myController release ];

I always see the view set-up code (in this case "myController.myProperty = itsValue") after the view has been displayed. It makes more sense to me to set up the view before calling pushViewController but this doesn't work. For example, if myProperty has a non-synthesized setter that expects IBOutlets to be bound it will be disappointed as they'll still be nil at this point.

So, my questions are:

Why doesn't initWithNibName create and bind all the IBOutlets before it returns?
Is the view guaranteed to be visible after pushViewController returns?
Or is it still animating on another thread?
Or is the request to display the view merely queued for the next loop through the RunLoop?

Similar situation with the call to makeKeyAndVisible - I've seen samples of applicationDidFinishLaunching where makeKeyAndVisible is called and then set up is done to the main window's view.

Thanks,
Brian.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to