Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 21, 2011, 07: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, 07: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, 08: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

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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
iOS 5 location services Problem Macgeeza iOS 5 and earlier 11 Sep 12, 2013 03:40 AM
iPhone 4S Location Services - Degredation in Accuracy? NightFox iPhone Tips, Help and Troubleshooting 5 Nov 4, 2011 05:38 PM
itouch location services... HOW? bevhoward iPod touch 2 May 12, 2011 12:54 PM
Locations services problem? MACloop iPhone/iPad Programming 1 Oct 9, 2009 09:18 AM
Location Service Problem during ViewDidLoad walty iPhone/iPad Programming 0 Sep 25, 2008 02:46 AM


All times are GMT -5. The time now is 10:59 PM.

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

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