To let the view controller know about the CLLocation Manager Delegate, you first import the corresponding header file.
In the “My Location View Controller.h”, add the #import statement and implement the “CLLocation Manager Delegate”.
If you’re developing a travel app, you can base on the users’ current location to search for nearby restaurants or hotels.
The service will then continuously send your application a stream of location data.
Place the cursor between the @interface and @end keywords, you should see a prompt that allows you to insert an outlet.
Repeat the same procedures and create the outlet for the “For Longitude Value” label and “For Address” label.
For the very first time you run the app, it’ll prompt the following alert to request for the access of location manager: “Location”. That’s the reason why you get the “Fail to Get Your Location” error.
Now change the location setting to “Apple” (or “Apple Stores”).