0

I'm developing an iOS 4 application.

I have a ViewController that contains another class. In this class, I use CoreLocation to track GPS and heading.

I want to notify ViewController that there is an error on GPS tracking with this method:

- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error

I want to check if user has disable Location tracking and show a AlertView, but I only can do that on a viewController.

How can I notify ViewController when this error occurs?

VansFannel
  • 45,055
  • 107
  • 359
  • 626

2 Answers2

0

You need to subclass your UIViewController and add the method needed to receive a specific error notification from your view.

simonpie
  • 354
  • 1
  • 5
0

You would either use a notification or delegation. In this case, delegation is a better fit. See my answers to and you should be able to adapt them accordingly for your case.

Community
  • 1
  • 1
Andrew
  • 7,630
  • 3
  • 42
  • 51