Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 21, 2011, 08:25 PM   #1
Blakeasd
macrumors 6502a
 
Join Date: Dec 2009
Core Location Services Problem

Hello,
I am just trying out Core Location for fun and I am having some problems.
I am trying to get the latitude of where I am but it is not working. There is no error, the problem is that my latitude displays as 0. Here is my code:
Code:
-(void)awakeFromNib{
    
    NSString *lattitude = [[NSString alloc]initWithFormat:@"%g",location.coordinate.latitude];
    [locationField setStringValue:lattitude];
                           
   

}
In my header file the only property I have set is the location property. I set the property like this:
Code:
@property(readonly NS_NONATOMIC_IOSONLY)CLLocation *location;
Does anyone know why my latitude shows as 0? I am sure it is something simple I forgot.
Thanks
Blakeasd is offline   0 Reply With Quote
Old Apr 21, 2011, 08:34 PM   #2
jiminaus
macrumors 65816
 
Join Date: Dec 2010
Location: Sydney
Quote:
Originally Posted by Blakeasd View Post
Does anyone know why my latitude shows as 0?
Possibly because location is nil. Sending a message to nil results in 0. Where do you create a CLLocation and set your location property?
jiminaus is offline   0 Reply With Quote
Old Apr 21, 2011, 09:28 PM   #3
Blakeasd
Thread Starter
macrumors 6502a
 
Join Date: Dec 2009
I did not, how do I?
Blakeasd is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Location services! MaximoMark iPhone 2 Dec 8, 2013 12:58 PM
Serious problem with my Location Services orr971 iPhone Tips, Help and Troubleshooting 0 Sep 22, 2013 09:37 AM
General: Can anyone get into Location Services after JB? JPNFRK7 Jailbreaks and iOS Hacks 7 Mar 7, 2013 07:04 PM
problem when app launched in Core Location Event Narendar Singh iPhone/iPad Programming 2 Nov 1, 2012 03:04 AM
YouTube using location (but location services are off) Roc P. iOS 6 23 Oct 28, 2012 10:02 AM

Forum Jump

All times are GMT -5. The time now is 08:55 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC