0

これが私の大きな問題です。「Assetlibrary.Framwork」を追加すると、mapViewがエラーで実行されます。ライブラリを削除すると、mapViewは正常に機能します。なんで?これが私のマップビューコードです:(ps私はストーリーボードを使用しています)

.h
@property (strong, nonatomic) IBOutlet MKMapView *MapView;

.m
viewdidload:
MapView.delegate = self;
[self setLocationManager:[[CLLocationManager alloc] init]];
[locationManager setDelegate:self];
[locationManager setDistanceFilter:kCLDistanceFilterNone];
[locationManager setDesiredAccuracy:kCLLocationAccuracyHundredMeters];
[locationManager startUpdatingLocation];

- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
if ((oldLocation.coordinate.longitude != newLocation.coordinate.longitude)
    || (oldLocation.coordinate.latitude != newLocation.coordinate.latitude)) {

    coord.latitude = newLocation.coordinate.latitude;
    coord.longitude = newLocation.coordinate.longitude;


    region.center = coord;

    span.latitudeDelta = 0.05;
    span.longitudeDelta = 0.05;
    region.span = span;
}

そして、これが私のエラーです:

'NSUnknownKeyException'、理由:'[setValue:forUndefinedKey:]:このクラスはキーMapViewのキー値コーディングに準拠していません。

マップビューを2回設定していますか?または私が間違ったこと?

4

0 に答える 0