我剛剛開始學習iPhone的iOS開發,並且關於如何使用MapKit Framework
顯示mapView的幾個示例,我發現不顯示Google地圖圖塊,僅我得到一個空的視圖(灰色瓷磚),至少在iPhone模擬器(我還沒有在設備上嘗試過)。iOS MKMapView在模擬器中不顯示地圖
我也收到此錯誤信息:
/SourceCache/GoogleMobileMaps_Sim/GoogleMobileMaps-363.1.2/googlenav/mac/Loader.mm:235 server returned error: 403
我發現類似的問題的解決方案爲Android開發的時候,而不是爲iOS。有人能幫我解決這個問題嗎?將MapKit
框架添加到項目中應該足以實現這個工作,或者我可能錯過了我所遵循的教程中未提及的一些額外設置?
謝謝!
這是我使用的簡單示例代碼:
// ViewController.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet MKMapView *mapView;
@end
// ViewController.m
#import "ViewController.h"
@implementation ViewController
@synthesize mapView=_mapView;
- (void)viewDidUnload {
[super viewDidUnload];
[self setMapView:nil];
}
... more methods...
而在的.xib文件,我連接的MKMapView
到該文件的所有者的MapView出口。在這一點上,根據教程,我應該能夠在運行模擬器時看到默認的美國地圖,但是我總是收到我在調試區域發佈的錯誤,而地圖視圖只顯示灰色空網格。
請張貼您的代碼。它會更容易幫助你:) –