cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wouter cx (JIRA)" <>
Subject [jira] [Commented] (CB-2392) Xcode 4.6 warning in CDVLocation
Date Tue, 12 Feb 2013 00:17:13 GMT


Wouter cx commented on CB-2392:

I had this issue also. IPhone simulator 6.1, using 2.4.
I had just downloaded PhoneGap 2.4, done the "Getting Started with iOS" tutorial.
After starting the simulator I got three errors, of which 2 were easily fixed by XCode itself.
After that this warning remained.
I did a little research just an hour ago, found a fix, and then I saw your fix.

I have a comment, I think this is not good practice to cast

Read this:

and this:
"I wouldn't consider this a good practice, casting UIInterfaceOrientation to UIDeviceOrientation!
I would rather see a structural fix."

and this:
"bad practice"

and this:

Also, the definition of supportsOrientation in supportsOrientation.m says 

- (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation

I changed it to this on my machine (this works, doesn't give any warnings anymore):

- (void)startHeadingWithFilter:(CLLocationDegrees)filter
    if ([self.locationManager respondsToSelector:@selector(headingOrientation)]) {
        UIInterfaceOrientation currentInterfaceOrientation = [UIApplication sharedApplication].statusBarOrientation;
        UIDeviceOrientation currentDeviceOrientation = [[UIDevice currentDevice] orientation];
        CDVViewController* cdvViewController = (CDVViewController*)self.viewController;

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

What do you think?
I'm still brand new to this stuff, so I hope I'm right.

> Xcode 4.6 warning in CDVLocation
> --------------------------------
>                 Key: CB-2392
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>            Reporter: Shazron Abdullah
>            Assignee: Shazron Abdullah
>            Priority: Minor
>             Fix For: 2.5.0
> See:
> Shows up when running on device.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message