使用CordovaLib时出错(xCode 4.6)

时间:2013-03-09 22:54:09

标签: cordova xcode4.6

这是给我错误的行

if ([cdvViewController supportsOrientation:currentOrientation]) {

错误消息是:从枚举类型'UIDeviceOrientation'(又名'enum UIDeviceOrientation')隐式转换为不同的枚举类型'UIInterfaceOrientation'(又名'enum UIINterfaceOrientation')

以下是完整的代码块:

    // helper method to check the orientation and start updating headings
- (void)startHeadingWithFilter:(CLLocationDegrees)filter
{
    if ([self.locationManager respondsToSelector:@selector(headingOrientation)]) {
        UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] orientation];
        if (currentOrientation != UIDeviceOrientationUnknown) {
            CDVViewController* cdvViewController = (CDVViewController*)self.viewController;

            if ([cdvViewController supportsOrientation:currentOrientation]) {
                self.locationManager.headingOrientation = (CLDeviceOrientation)currentOrientation;
                // FYI UIDeviceOrientation and CLDeviceOrientation enums are currently the same
            }
        }
    }
    self.locationManager.headingFilter = filter;
    [self.locationManager startUpdatingHeading];
    self.headingData.headingStatus = HEADINGSTARTING;
}

0 个答案:

没有答案