xcode


CLLocationManager startUpdatingLocation not working in application:didFinishLaunchingWithOptions:


I'm using the CLLocationManager startUpdatingLocation in the AppDelegate's method application:didFinishLaunchingWithOptions:
The delegate method are never fired.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
[self performSelectorOnMainThread:#selector(startUpdatingLocation) withObject:nil waitUntilDone:NO];
// [self startUpdatingLocation];
return YES;
}
-(void)startUpdatingLocation
{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
[locationManager startUpdatingLocation];
}
I've tried both, using main thread and just calling my method, but none of them is working.
I've implemented all these method, but none of them is triggered:
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
Solution:
https://devforums.apple.com/message/1073496#1073496

Related Links

Installed gcc using xcode , but gcc still not found [duplicate]
Google maps sdk - Map overlays evrything in my storyboard
Detecting when a button is touched in SKScene?
Non-generic Swift class can implement UIPickerViewDataSource but Generic version can't
How can I get the Xcode6 editor to highlight the lines I have changed from my last commit?
XCode: to create IPA Archive, is it always in release mode?
How to set the width of an NSTableColumn in Swift
XCode Project - ld: library not found for -llib
Calculation of DayInEra inconsistent with DayInYear
Drawing performance with multiple UIBezierPaths
Trying to unhide UITextView from behind keyboard
fobjc-arc error from xcodebuild in jenkins
Xcode loading AppDelegate from another target
How can I update a view controller when something happens in a container view controller?
Core Location doesn't work with Apple watch
Why is viewDidLoad run before didSelectItemAtIndexPath?

Categories

HOME
amazon-web-services
keyboard
odata
apk
twitter-fabric
amp
material-components
apache-kafka-connect
ontology
stored-procedures
solution
slide
nsstring
circleci
pm2
mpu6050
sonata
fresco
twisted
heap-dump
vmware-workstation
pinterest
c#-7.0
infrared
sharedpreferences
stackexchange.redis
quantitative-finance
pyopencl
high-availability
spreadsheetgear
offline-caching
onchange
microprocessors
javax.persistence
guice
instructions
steam-web-api
memory-fences
payeezy
orchardcms-1.8
assertions
love2d
praat
best-buy-api
imgur
get-event-store
elasticsearch-aggregation
jqgrid-asp.net
autorelease
rm
lightning-workbench
node-apn
android-sharing
hmmlearn
xcode6.4
e
logical
livereload
fuzzer
dojo-build
fiber
verisign
wepay
self
ruby-on-rails-4.1
openshift-cartridge
dnx50
screen-orientation
pythonxy
vdm-sl
kognitio-wx2
adhoc-polymorphism
object-code
lmax
siena
forio-contour
reference-counting
tabletools
xmi
flipboard
autonumber
strcmp
progress-db
ggts
application-server
jquery-transit
acceptance-testing
asp.net-mvc-3-areas
xcode4.5
series-40
differentiation
git-log
tessellation
reliability
powergui
index.dat
word-automation

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App