objective-c - 请求解决 iOS MKMapView 使用是内存暴增的方法?
淡淡烟草味
淡淡烟草味 2017-05-02 09:25:17
0
0
499

1、项目使用TabBarController 添加4个界面 其中3个界面使用MKMapView
2、// 实时追踪

RealTimeTrackingViewController *realTimeTrackingVC = [[RealTimeTrackingViewController alloc] init];
[self setUpOneChildViewController:realTimeTrackingVC image:[UIImage imageNamed:@"tracking"] selectedImage:[UIImage imageWithOriginalName:@"trackingpress"] title:@"实时追踪" ];
_RealTimeTracking =realTimeTrackingVC;
//历史回放
HistoricalPlayViewController *historicalPlayVC = [[HistoricalPlayViewController alloc] init];
[self setUpOneChildViewController:historicalPlayVC image:[UIImage imageNamed:@"playback"]  selectedImage:[UIImage imageWithOriginalName:@"playpress"]  title:@"历史回放" ];

// 电子围栏
GeofenceViewController *geofenceVC = [[GeofenceViewController alloc] init];
[self setUpOneChildViewController:geofenceVC image:[UIImage imageNamed:@"geo"] selectedImage:[UIImage imageWithOriginalName:@"geopress"] title:@"电子围栏" ];

// 设备报警
VehicleAlarmViewController *vehicleAlarmVC = [[VehicleAlarmViewController alloc] init];
[self setUpOneChildViewController:vehicleAlarmVC image:[UIImage imageNamed:@"alarm"] selectedImage:[UIImage imageWithOriginalName:@"alarmpress"] title:@"设备警告"];

3、打开两个含有地图的界面后,内存达到近400MB

依次打开3个含有地图的界面后,内存再暴增到近500MB

最最关键的是:由于使用的是UITabBarController,切换界面时,界面是不会释放掉的,我不知道怎样才能释放MapView。。。。。
现在求帮助。。。。。。。。。。。

淡淡烟草味
淡淡烟草味

Antworte allen(0)
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage