2

这是给我错误的行

if ([cdvViewController supportsOrientation:currentOrientation]) {

错误消息是:从枚举类型“UIDeviceOrientation”(又名“枚举 UIDeviceOrientation”)到不同枚举类型“UIInterfaceOrientation”(又名“枚举 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;
}
4

0 回答 0