Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-19-2010, 02:53 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 51
Dan the Man is on a distinguished road
Send a message via Yahoo to Dan the Man Send a message via Skype™ to Dan the Man
Default Current Location output?

hello, I have been trying to get the users location. And I have a map that shows the location, but how do I get that outputed to a variable (float) or something?

Do I have to use the core locations or can I stick to the Map Kit?
Dan the Man is offline   Reply With Quote
Old 08-19-2010, 03:23 PM   #2 (permalink)
Use [code] tags please
 
Join Date: Jun 2009
Location: Jacksonville, FL
Posts: 410
timle8n1 is on a distinguished road
Default

Quote:
Originally Posted by Dan the Man View Post
hello, I have been trying to get the users location. And I have a map that shows the location, but how do I get that outputed to a variable (float) or something?

Do I have to use the core locations or can I stick to the Map Kit?
Code:
MKMapView *aMapView = ...
MKUserLocation *userLocation = [aMapView userLocation];
CLLocation *location = [userLocation location];
timle8n1 is offline   Reply With Quote
Old 08-19-2010, 04:24 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 51
Dan the Man is on a distinguished road
Send a message via Yahoo to Dan the Man Send a message via Skype™ to Dan the Man
Default

but how do i put that into an alert view? And where do I put that block of code so that it happens when the location is found?
Dan the Man is offline   Reply With Quote
Old 08-20-2010, 10:05 AM   #4 (permalink)
Use [code] tags please
 
Join Date: Jun 2009
Location: Jacksonville, FL
Posts: 410
timle8n1 is on a distinguished road
Default

Quote:
Originally Posted by Dan the Man View Post
but how do i put that into an alert view? And where do I put that block of code so that it happens when the location is found?
Register an MKMapViewDelegate with your MKMapView and implement this method

Code:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
timle8n1 is offline   Reply With Quote
Reply

Bookmarks

Tags
core location, current location, map

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 343
5 members and 338 guests
freewind, givensur, lendo, Newbie123, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:54 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0