I am getting an error when my application becomes active again. it returns from background.
I am guessing its my gyro but haven’t found a solution.
My error:
-[WebDataSource onGeomagneticModel:]: unrecognized selector sent to instance 0x37c430
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WebDataSource onGeomagneticModel:]: unrecognized selector sent to instance 0x37c430'
my applicationDidEnterBackground:
- (void)applicationDidEnterBackground:(UIApplication *)application{
NSLog(@"Application moving to background");
LocationManagerDelegate *locationController = [[LocationManagerDelegate alloc] init];
[locationController.locationManager stopUpdatingHeading];
[locationController stopDeviceMotion];
}
It looks like you create another LocationManagerDelegate instance.
So.. the “old” instance you did NOT turn of.
You should add in you .h file
Then add above the @implementaion in the .m file
There where you crate your LocationManagerDelegate you need to change it somehow to (you did not post that part of code):
Then change your code to: