谷歌在iPhone 4上映射API崩溃

时间:2013-07-02 18:38:36

标签: ios google-maps google-maps-sdk-ios ios6.1

我正在努力将Google地图放入iPhone应用中。该应用适用于ipad第4代,第5代ipod和iphone。但是在第4代设备上如果收到内存错误警告。如下:

    2013-07-02 12:11:17.745 Maps Test[33509:907] Received memory warning.
    2013-07-02 12:28:07.112 Maps Test[33558:907] Memory Error
    2013-07-02 12:11:20.683 Maps Test[33509:907] Received memory warning.
    2013-07-02 12:28:07.112 Maps Test[33558:907] Memory Error
    2013-07-02 12:11:44.643 Maps Test[33509:907] Received memory warning.
    2013-07-02 12:28:07.112 Maps Test[33558:907] Memory Error

这是我为一段示例代码获得的唯一错误 示例代码如下。

#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController{
    GMSMapView *mapView_;
}
-(void)loadView
{
    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude: -33.86         longitude:151.20 zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
self.view = mapView_;
//create a marker on the map
GMSMarker *marker = [[GMSMarker alloc]init];
marker.position = CLLocationCoordinate2DMake(-33.86,151.20);
marker.title = @"Sydney";
marker.snippet = @"Australia";
marker.map = mapView_;
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    NSLog(@"Memory Error");
    // Dispose of any resources that can be recreated.
}
@end

我没有收到任何级别警告或任何其他帮助,以便我找出问题。在将地图从悉尼滚动到我当前位置后,应用程序崩溃,没有任何错误或任何其他提示,显示应用程序崩溃的原因。它会触发didReceiveMemoryWarning,但是因为这就是所有运行的东西我可以杀死什么来保持应用程序在使用地图时还活着?

提前致谢!

0 个答案:

没有答案