Problem with geolocation on iPhone - iphone

I have developed a simple program for current user location following this tutorial :
http://www.youtube.com/watch?v=qNMNRAbIDoU
However when I build and run, the map is shown but the cuppertino location (apple headquarters) is not located on the map.
I heard that the problem may be that apple didn't recognize my wifi or something like that, is this possible, and if so, should I keep my code and suppose it to be true and so wait to test it on device later? Thanks in advance

Make sure you watch to the end of the tutorial as he makes a mistake on the method name, which he corrects, to be honest it doesn't look like a very good tutorial, I'd find another.

In Simulator, the blue dot will always pinpoint the Mothership.
However, mapView.userLocation.coordinate will in fact return your current location coordinate (based on Wifi, so be sure it's on).
Note, though, in pre-4.0, mapView.userLocation.coordinate is returns the coordinates for the Mothership.
Once you start testing on your device the blue dot will appear correctly in your MKMapView. Be sure to test your app on a device when using CLLocation and MKMapView, especially if you rely on the users location for anything. Well, always be sure to test your app on a device :)

Related

DJI Assistant 2 simulator will not run missions. DJI ERROR 5021 "TOTAL MISSION DISTANCE TOO LARGE"

So I have been writing an application to run custom missions, the missions run fine and everything works as intended, however when attempting to run on the simulator I receive this error.
The missions should not be considered too large as I calculate distance at 1081m and attempting to physically run this mission succeeds. Trying to do the same in the simulator is resulting in error code 5021.
If it is helpful I also get error code 1003 "This process has timed out"
Any help with this would be appreciated as I have spent much time trying to solve this issue.
I can provide further info if needed however nothing seems relevant at this time except that which I have said.
Are you using the waypoint function to let the drone move with pre-defined latitude and longitude? If the answer is yes! then possibly that because the constant latitude and longitude in the GUI of the simulator are far from your GPS points.
And this is not allowed from the SDK for safety reasons.
So, basically, it is not allowed to set waypoints far from the Home location (the location where the drone would take off from)
As Mohamad Ghaith Alzin mentioned, maybe the waypoints in your mission are too far away from the home located in the simulator. You can try to set the location in the simulator to the location of the first/start waypoint. You can do it before starting the simulator like below:
the simulator GUI

Background GPS in iOS. Is this possible?

I was wondering if it was possible to get the location of the iPhone with an app that isnt running, or at least running in the background. What I want to do is have the iPhone send a push notification when it arrives at a certain coordinate. Is this possible? If so, could someone put me in the right direction?
Thanks,
Ben
Yes, it is possible. Your application can ask to be notified of significant location changes or to simply continue using the GPS while executing in the background. The former—the approach recommended by Apple—uses less power at the cost of accuracy (this blog post indicates that the updates are accurate to roughly 500m), while the latter is as accurate as the device can manage. This is all detailed in the iOS Application Programming Guide and and the Location Awareness Programming Guide.
If you simply want your application to be notified when the device moves into a particular region, you may want to look into CLLocationManager's startMonitoringForRegion:desiredAccuracy:. If the device moves into a particular geographical region, your app is launched (even if it's not running!).

show current user location?

I know this has been asked by many others. I just wanted to know that by now the simulator is still unable to detect the current location (it always detects it as Cupertino). Is this true? Has apple actually done some update on this issue?
No, and they won't. The simulator is a joke. It should only be used when fiddling around before you get approved for the iOS Dev program. All actual debugging should be done on a device. Period.
In the simulator you cant see the current location,if u write code for to display current location, in simulator it shows default sanfrancisco location.Run That application in device then it shows curtrent location

how to determine current location from GPS in iphone

I needed to implement the positioning functionality in my next app. I got a few questions regarding the development.
1) I found the tutorial and implemented the positioning thing.. but is it possible to simulate my code with iphone simulator or is it necessary to use the device for this purpose. while googling i read on some forum that 4.2 SIM supports GPS apps simulation though it will give Apple's headquarter's location every time but in my case the CLLocationManager's didFailWithError delegate gets called. any help with that!!
2) After determining the position, longitude and latitude, how to determine the exact area name and other information from it?
Thanks in advance for your invaluable time and feedbacks.
CLLocationManager will in fact return the location of the network the simulator is using. It's MapKit that will think the current location is in Cupertino at Apple's headquarters. That you get two different locations from the calls often causes confusion.
You can get information about a given latitude and longitude by using the MKReverseGeocoder. It will attempt to give you a full address, but you can use whatever portion of it you'd like (just the country, or city and state/province, whatever).

Pinch Media - Core Location Optional

Will using PinchMedia and including Core Location frameworks make it unusable on the iPod Touch which doesn't have GPS? If so, is there a way to minimize this dependency since my actual application doesn't care? It would be nice to see, but basically I'm trying to use it to provide feedback from users on things they'd like to see improved or added, or corner cases where my unittests didn't capture.
Core Location exists on the iPod touch also - it falls back on WiFi to do location if there is no GPS
That said, your users may find it odd as your app will ask for their location for no apparent reason, if it has nothing to do with your app. I would personally find that a good enough reason to ditch an app.