2

これが私にエラーを与えている行です

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;
}
4

0 に答える 0