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 6915173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:26:31+00:00 2026-05-27T09:26:31+00:00

the situation is following, i am running xCode 4.1 on MacOS 10.7, starting iPhone

  • 0

the situation is following, i am running xCode 4.1 on MacOS 10.7, starting iPhone simulator and using MapKit am trying to get REAL user’s coordinates … default user’s location is in Cupertino, USA … to get cordinates of this point i use :

self.mapView.userLocation.location.coordinate

… but this gets me to the center of the map (in Africa) …

Question #1 : Why??? Why user’s pin is set to Cupertino but its coordinates are (lat:0, lon:0) in Africa?

… then …

I have setup my controller as CCLocationManagerDelegate and MKMapViewdelegate and initialized controller as delegate for CCLocationManagerDelegate’s events … but neither of these delegate methods was called …

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation

Question #2 : Why delegate methods are not triggered even once?

My controller :

//@interface MapController : UIViewController<CLLocationManagerDelegate, MKMapViewDelegate> 

//@property (nonatomic, retain) MapModel *mapModel;
//@property (nonatomic, retain) IBOutlet MKMapView *mapView;

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

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{ ... }

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{ ... }

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.mapModel = [[[MapModel alloc] init:self] autorelease];

    [self.mapView setShowsUserLocation:YES];
    [self.mapView setZoomEnabled:YES];
    [self.mapView setScrollEnabled:YES];
    [self.mapView setMapType:MKMapTypeStandard];

    CLLocationCoordinate2D x = 
        self.mapView.userLocation.location.coordinate; // (0,0) why???

    //[self.mapView setRegion:xx animated:YES];
    //[self.mapView regionThatFits:self.mapModel.region];
    [[self.mapView userLocation] setCoordinate:[x coordinate]];
}

...

And model :

   //@property (nonatomic, copy) NSString *user;
   //@property (nonatomic, copy) NSString *caption;
   //@property (nonatomic, copy) NSString *description;
   //@property (nonatomic, assign) MKCoordinateRegion region;
   //@property (nonatomic, retain) CLLocationManager *manager;

    - (id)init :(id)delegate
    {
        self.manager = [[[CLLocationManager alloc] init] autorelease];

        self.manager.delegate = delegate;
        self.manager.distanceFilter = kCLDistanceFilterNone;
        self.manager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
        [self.manager startUpdatingLocation];

        MKCoordinateRegion region = {{0, 0}, {0.2, 0.2}};

        self.region = region;

        return self;
    }

Thanks, Art

  • 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-05-27T09:26:31+00:00Added an answer on May 27, 2026 at 9:26 am

    The default location in the simulator is Cupertino. In the latest Xcode (4.2, I believe), you can set the location of the simulator from a menu of prepopulated locations (to which you can add your own simply by including a GPX file in your project).

    If you run on the device AND ENABLE LOCATION SERVICES FOR THE APP, you should get a valid location using your code.

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

Sidebar

Related Questions

We've got the following situation, running from a single domain: Page A uses window.open()
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I am running a C# application, and during run-time I get the following error:
I'm trying to overcome the following situation. Given a directory stored on an NTFS
I'm using EF 4.1 code first. Running into a very weird situation: Database does
I have the following situation: using a classical Java server (using ServerSocket) I would
I have the following situation: Windows Server environment with multiple user sessions. Windows Service
Following situation: I have a JFrame and call JOptionPane.showInputDialog(test) . The modal dialog will
I have following situation. A main table and many other tables linked together with
Picture the following situation. I have an XML document as follows, <Form> <Control Type=Text

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.