So i am trying to make a game that will load a specific XIB file according to the device's orientation at launch. my code looks like this:
- (id)initWithNibName:(NSString *)nibName owner:owner bundle:(NSBundle *)bundleName {
if (UIDeviceOrientation == UIDeviceOrientationLandscapeLeft || UIDeviceOrientation == UIDeviceOrientationLandscapeRight) {
[[NSBundle mainBundle] loadNibNamed:@"Landscape.xib" owner:self options:nil];
}
if (UIDeviceOrientation == UIDeviceOrientationPortrait || UIDeviceOrientation == UIDeviceOrientationPortraitUpsideDown) {
[[NSBundle mainBundle] loadNibNamed:@"Portrait.xib" owner:self options:nil];
}
return self;
}
and i get this error: on both occurrences of UIDeviceOrientation: "error: expected expression before 'UIDeviceOrientation'".
Does anyone know what it is asking for or what i'm doing wrong?