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

  • Home
  • SEARCH
  • 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 8376887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:32:01+00:00 2026-06-09T15:32:01+00:00

I added the CoreLocation framework, and I keep rereading the code in my book

  • 0

I added the CoreLocation framework, and I keep rereading the code in my book to make sure I copied it down correctly but I am getting a persistent No visible @interface for 'CLLocation' declares the selector 'setDesiredAccuracy:' error.

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>

@interface WhereamiViewController : UIViewController {
    CLLocation *locationManager;
}

@end

#import "WhereamiViewController.h"

@interface WhereamiViewController ()

@end

@implementation WhereamiViewController

-(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {
        locationManager = [[CLLocation alloc] init
        [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
    }
    return self;
}
@end
  • 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-09T15:32:03+00:00Added an answer on June 9, 2026 at 3:32 pm
    CLLocation
    

    is a location object, it holds a specific coordinate/location, that can be displayed on a map view. However, CLLocationManager is an object which manages location and heading updates. setDesiredAccuracy is the method where you set the accuracy of the location manager’s location and heading updates. If you set the accuracy high, the location manager will update with a very accurate point of where you are, but considerably slow. (Not really, but when you compare to other accuracies).

    The delegate method where the location updates it:

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

    To start the updates, you can first customize it like you said, with the accuracy and distance filter. Then to start, simply write:

    [locationManager startUpdatingLocation];
    

    And, so I can guess how you would stop updates.

    NOTE: If you are on ARC, make your location manager an instance variable (declared in .h) because it releases the location manager very quickly and the popup to let the user decide if your app can track you location will popup and then disappear in less than a second. And of course your locations wont update.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added a category to CLLocation in CoreLocation but kept getting a link error.
I added this code to the head but when I try to post something
I added in the @user = User.new line to make sure it isn't nil.
I'm currently building an iOS app via Xcode that utilises the corelocation.framework, but unfortunately
Added Database Source Bean to Spring.xml and getting error. why can't I make my
I added an event handler to the WebClient's DownloadProgressChanged event, but it never seems
I added this part of the code in my onCreate() method and it crashes
I am using the following code to get the current location,I have added the
Added this code NSDateFormatter *df = [[NSDateFormatter alloc]init]; NSString *entry = @March 28, 2012;
I added the following code segment to my project to force the JScrollPane automatically

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.