I'm using code from:
http://www.veasoftware.com/tutorials/2014/6/17/xcode-5-tutorial-ios-7-simple-compass-app
In Xcode 6 I get the error below. The app still runs, but this error is really annoying me.
self.locationManager.delegate = self;
//Assigning to 'id<CLLocationManagerDelegate>' from incompatible type 'ViewController *const __strong'
I guess you forgot to comply with the Core Location Delegate protocol by adding <CLLocationManagerDelegate>
after @interface
in the header file.
Try this:
1)Make your class import the below:
#import<CoreLocation/CoreLocation.h>
2) Make you class adopt the protocol:
interface YourClassName : UIViewController <CLLocationManagerDelegate>
3) In Last option to suppress it by doing:
self.locationManager.delegate = (id)self;
The warning should be gone now.
self.locationManager.delegate = (id)self;