我在
xcode中尝试了一些东西,我将这个代码用于我的MapView.
No kNown class method for selector
'setRegion:animated:'
我用3 .h和.m文件制作了三个View Controller.
我的错是什么?
.M
#import "myPlacesAllTime.h" #import <MapKit/MapKit.h> @interface myPlacesAllTime () @end @implementation myPlacesAllTime - (id)initWithNibName:(Nsstring *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; MKCoordinateRegion startRegion = { {0.0,0.0},{0.0,0.0} }; startRegion.center.latitude = 35.88905; startRegion.center .longitude = -17.605591; startRegion.span.latitudeDelta = 0.1; startRegion.span.longitudeDelta = 0.1; [myPlacesAllTime setRegion:startRegion animated: NO]; }
.H
#import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface myPlacesAllTime : UIViewController <MKMapViewDelegate>{ __weak IBOutlet MKMapView *myPlacesAllTime; } @end