[iPhone 3.0; XCode 3.1.3] Question about when views are available for manipulation.
[iPhone 3.0; XCode 3.1.3] Question about when views are available for manipulation.
- Subject: [iPhone 3.0; XCode 3.1.3] Question about when views are available for manipulation.
- From: Brian Bruinewoud <email@hidden>
- Date: Sat, 8 Aug 2009 18:23:16 +1000
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 (email@hidden)
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:
This email sent to email@hidden