Hi all,
I'm having trouble with the didRotateFromInterfaceOrientation function.
It works fine, like I expected to work. However, when I get in this view when my device is already rotated to landscape I'm getting the following error.
How can I make my app taking care of this hiding and unhiding objects from the start, without the didRotate to be crashing?
For now I have a boolean before I check the 'if(UIDeviceOrientationIsLandscape(fromInterfaceOrientation))'
Which will be true in the end of viewdidappear, and in viewdidload I check if my statusbar orientation is landscape, then do the same things as in didRotateFromInterfaceOrientation and keep the boolean false.
I'm having trouble with the didRotateFromInterfaceOrientation function.
It works fine, like I expected to work. However, when I get in this view when my device is already rotated to landscape I'm getting the following error.
Code:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
Code:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
if(UIDeviceOrientationIsLandscape(fromInterfaceOrientation))
//Make sure everything is in place
else
//Remove bottombar topbar etc etc
}
How can I make my app taking care of this hiding and unhiding objects from the start, without the didRotate to be crashing?
For now I have a boolean before I check the 'if(UIDeviceOrientationIsLandscape(fromInterfaceOrientation))'
Which will be true in the end of viewdidappear, and in viewdidload I check if my statusbar orientation is landscape, then do the same things as in didRotateFromInterfaceOrientation and keep the boolean false.
Last edited: