Is it an iphone simulator capable of showing title and latitude, longitude?

I am using iphone simulator 4.2 and trying to display either NSLog Headers and other attributes of location services, for example. Latitude, longitude, height, horizontal accuracy, vertical accuracy, speed. but it does not show the correct parameters and Incase of Heading, without actually launching this event. how to execute it CLLocation code

 - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { [self.delegate locationUpdate:newLocation]; } 

and does not execute CLHeading code

 - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { [self.delegate headingUpdate:newHeading]; } 

and when I set a breakpoint on both of these codes, it never touches the CLHeading code. I am updating the location and title in init.

 - (id) init{ if (self!=nil) { self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate = self; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter = kCLDistanceFilterNone; [self.locationManager startUpdatingLocation]; [self.locationManager startUpdatingHeading]; } return self; } 

The problem is that I don’t know what is connected with the simulator or are there any problems with the code?

Please, help.

+6
source share
3 answers

CLLocationManager requires additional hardware and therefore will not work on the simulator. However, you can verify this using the method described in this other SO question .

From the documentation :

Some location services require certain equipment on this unit. For example, header information is only available for devices that contain a hardware compass. This class defines several methods that you can use to determine which services are available.

+13
source

This answer can be updated for anyone using Xcode 4.2. It is still in beta, but if you are a paid developer, you will have access to it. In addition, if you are a paid developer, there are good videos from WWDC 2011 that explain how to use the simulator to simulate a location.

WWDC 2011

See what's new in the base layout and testing of your location-oriented app without leaving your chair.

** Note. Please note that only paid developers have access to these videos.

+3
source

It looks like the default behavior. It triggers a location but does not light up.

I have not tested my application in real hardware to validate it, though ...

Anthony Desa

+2
source

Source: https://habr.com/ru/post/894162/


All Articles