I have this created under my viewdidload()
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
UIDeviceOrientation orientationType = [[UIDevice currentDevice] orientation];
And i go about testing orientation by doing these in a function:
if(orientationType == UIDeviceOrientationPortrait || orientationType == UIDeviceOrientationPortraitUpsideDown)
{
testingLabel.text = @"ZOOM PORTRAIT DETECTED";
}
else if (orientationType == UIDeviceOrientationLandscapeLeft || orientationType == UIDeviceOrientationLandscapeRight)
{
testingLabel.text = @"ZOOM LANSCAPE DETECTED!";
}
else
{
testingLabel.text = @"NONE";
}
*testingLabel is linked correctly and tested*
I test by going to the hardware->Rotate Left/ Rotate Right.
And i will do something to call out the function. Upon called, the debugger show "NONE"
Am i missing out something? Or it is just that I will need to test on an actual iPhone?
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
UIDeviceOrientation orientationType = [[UIDevice currentDevice] orientation];
And i go about testing orientation by doing these in a function:
if(orientationType == UIDeviceOrientationPortrait || orientationType == UIDeviceOrientationPortraitUpsideDown)
{
testingLabel.text = @"ZOOM PORTRAIT DETECTED";
}
else if (orientationType == UIDeviceOrientationLandscapeLeft || orientationType == UIDeviceOrientationLandscapeRight)
{
testingLabel.text = @"ZOOM LANSCAPE DETECTED!";
}
else
{
testingLabel.text = @"NONE";
}
*testingLabel is linked correctly and tested*
I test by going to the hardware->Rotate Left/ Rotate Right.
And i will do something to call out the function. Upon called, the debugger show "NONE"
Am i missing out something? Or it is just that I will need to test on an actual iPhone?