iPhone: What gets called after viewDidLoad before viewWillAppear?

后端 未结 3 927
南方客
南方客 2021-01-04 08:07

Really strange behaviour here. I\'ve got a view with a scroll view inside, which contains my interface.

In my viewDidLoad, I set the frame of my scrollV

相关标签:
3条回答
  • 2021-01-04 08:15

    If you want to find out what it could be, you can try registering your view for key value observing, as described here: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html

    You can register to listen for changes to the frame property, and then set a breakpoint in the observe method which should let you see exactly what the stacktrace is for when your origin is set to the strange value.

    0 讨论(0)
  • 2021-01-04 08:19

    You are correct with the current method precedence:

    -(void)loadView;
    -(void)viewDidLoad;
    -(void)viewWillAppear;
    -(void)viewDidAppear;
    

    Is there perhaps a rotation call or some other method in the way, such as didRotateToInterfaceOrientation; for example? Also, is this scroll view part of a controller that's loaded from a nib file?

    0 讨论(0)
  • 2021-01-04 08:39

    20 pixel discrepancies and nib files always seem to be woe, but with Interface Builder and status bars. Are you setting up the nib with the same status-bar state as what your using in your app?

    If you've hidden your status bar in your app, have you done the same in Interface Builder?

    0 讨论(0)
提交回复
热议问题