[英]iOS compile error: no visible @interface for 'CDVCommandDelegateImpl' declares the selector 'execute:'
[英]iOS compile error: No visible @interface for 'setLocationManager' declares the selector
我目前正在#Augmented Reality上完成Ray Wenderlich iOS教程,並且遇到一個問題,涉及在MainViewController界面中找不到setLocationManger? 我該如何解決?
我不明白,因為我認為這已包含在CoreLocation / Corelocation.h類中。
#import "MainViewController.h"
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
@interface MainViewController () <CLLocationManagerDelegate, MKMapViewDelegate>
@property (weak, nonatomic) IBOutlet MKMapView *mapViewPointer;
@property (nonatomic, strong) CLLocationManager *locationManagerPointer;
@end
@implementation MainViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Roll Tide
[self setLocationManager:[[CLLocationManager alloc] init]];
[_locationManagerPointer setDelegate:self];
[_locationManagerPointer setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
[_locationManagerPointer startUpdatingLocation];
@property (nonatomic, strong) CLLocationManager *locationManagerPointer;
將locationManagerPointer
重命名為locationManager
或將設置程序稱為
[self setLocationManagerPointer:[[CLLocationManager alloc] init]];
聲明屬性時,將自動創建setter和getter。
如果將屬性聲明為@property NSString *userName
,則將創建一個具有setUserName
方法和getter userName
方法的setter。 您可以使用[self setUserName:@"fooBar"]
和[self userName]
來訪問它們。 錯誤的原因是您的財產名稱不同於您的財產設定者。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.