Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8497139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:02:47+00:00 2026-06-11T00:02:47+00:00

My core location works but I receive a warning at this line of code.

  • 0

My core location works but I receive a warning at this line of code. locationManager.delegate = self; The warning is Assigning to ‘id’ from incompatible type ‘phoneLocationViewController *const __strong’. How do I get rid of this warning? Here is my code

.h

@interface phoneLocationViewController : UIViewController {

}

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation    
*)newLocation fromLocation:(CLLocation *)oldLocation;

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;



@property (nonatomic, retain) CLLocationManager *locationManager;
@property (nonatomic, retain) CLLocation *currentLocation;

.m

@synthesize locationManager, currentLocation;

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation  
*)newLocation fromLocation:(CLLocation *)oldLocation {
self.currentLocation = newLocation;

if(newLocation.horizontalAccuracy <= 100.0f) { [locationManager stopUpdatingLocation]; }
}

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
if(error.code == kCLErrorDenied) {
    [locationManager stopUpdatingLocation];
} else if(error.code == kCLErrorLocationUnknown) {
    // retry
} else {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error retrieving location"
                                                    message:[error description]
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
    [alert show];
}
}

- (void)viewDidLoad
{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self; (I GET THE WARNING HERE)
[locationManager startUpdatingLocation];

[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
[locationManager stopUpdatingLocation];

[super viewDidUnload];
// Release any retained subviews of the main view.
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:02:48+00:00Added an answer on June 11, 2026 at 12:02 am

    Declare your class as implementing the protocol of the delegate of the location manager.

    @interface phoneLocationViewController : UIViewController <CLLocationManagerDelegate> {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/
I have a coordinate from Core Location and want to calculate the co-ordinate given
How to get the Direction from Compass Calibration, i used core location framework and
I have used Core location framework to receive my GPS coordinates in my IPOD.First
Works fine on the local machine, but when deployed this error message pops up:
I have implemented core location in my app. Everything works perfect when user allows
hello i'm going to get array data from for. i have a code but
I am using core location framework inside my app and sending updated location to
I am using core location framework inside my app.The didUpdateToLocation method is called two
Will using PinchMedia and including Core Location frameworks make it unusable on the iPod

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.