Note that there are some explanatory texts on larger screens.

plurals
  1. POiphone gps cllocation and making variables globally accessible
    primarykey
    data
    text
    <p>I'm pretty new to iPhone development and have been trying to work out how to include GPS information into an app I'm working on. I've gone through the HelloThere tutorial, which is a great start</p> <p><a href="http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/" rel="nofollow noreferrer"><a href="http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/" rel="nofollow noreferrer">http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/</a></a></p> <p>And had no problems getting this to run on my iPhone. I then took the example and have since been trying to incorporate the GPS info into a much larger and more complicated app. The larger application has an existing function which will send a post request to the server, and I'd like to simply provide the location data, specifically the coordinate.latitude and coordinate.longitude to this function, if possible without altering it.<br> This is pretty trivial in the other languages I've worked with but it's turned out to be quite challenging in objective C.<br> Basically, as per the tutorial I have gotten to the point where I'm logging the location info, <pre><code> //GPS stuff - (void)locationUpdate:(CLLocation *)location { //locationLabel.text = [location description]; locationString = [location description]; locationLabel.text = locationString; locLat = [NSString stringWithFormat:@"%lf", location.coordinate.latitude]; locLong = [NSString stringWithFormat:@"%lf", location.coordinate.longitude]; } </pre></code></p> <p>but I can't figure out how I can then make the locLat and locLong variables available to other parts of the application. Pretty lame but I'm still a bit lost with objective C.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload