In "View Did Load" I'm trying to determine the size of the view so I can appropriately size a subview. I want it to always stretch about the length and width of the screen regardless of orientation.
quest *anview = [[quest alloc] initWithFrame: CGRectMake(50, 50, self.view.frame.size.width-100, self.view.frame.size.height-100)];
self.aquest=anview;
But this always returns a width of 748 and a height of 1024 when it should return the opposite when I'm in landscape. I know that you can't get orientation on the simulator but this occurs on the device as well. When I get the orientation:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
NSLog(@"device orientation:%d",orientation);
I correctly get the orientation but this log statement returns the 748/1024 regardless of orientation.
NSLog(@"size w:%f",self.view.frame.size.width);
NSLog(@"size h:%f",self.view.frame.size.height);
Anyone know what's going on? Does this have to do with me putting this in the viewdidLoad method? Should I put it in viewWillAppear or viewDidAppear?