0

我已经开始在我的项目中使用谷歌地图而不是苹果地图,它工作正常。我试图放置街景(我是在单一视图中完成的)。它加载图像很好,但是当我尝试环顾四周时,“收到的内存警告”即将出现,并且在第二次使用街景应用程序时关闭,没有任何错误。代码目前非常基本:

地图街景.h

#import <UIKit/UIKit.h>

@interface MapStreetView : UIViewController

@end

地图街景.m

#import "MapStreetView.h"
#import <GoogleMaps/GoogleMaps.h>

@interface MapStreetView ()

@end

@implementation MapStreetView
{
    GMSPanoramaView *panoView_;
}



- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];


}


- (void)loadView {
    panoView_ = [[GMSPanoramaView alloc] initWithFrame:CGRectZero];
    self.view = panoView_;

    [panoView_ moveNearCoordinate:CLLocationCoordinate2DMake(-33.732, 150.312)];

}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

在 Instruments 中,我发现应用程序占用的内存越来越多,当我有大约 70Mb 的 Dirty 时它会崩溃。

此外,在模拟器中一切正常。我使用的设备是 iPad 1。

任何人都可以帮我解决它吗?这是我项目中非常有趣的选择。

4

0 回答 0