1. The project uses TabBarController to add 4 interfaces, 3 of which use MKMapView
2. // Real-time tracking
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. After opening two interfaces containing maps, the memory reaches nearly 400MB
After opening three interfaces containing maps in sequence, the memory increased to nearly 500MB
The most important thing is: since UITabBarController is used, the interface will not be released when switching interfaces. I don’t know how to release MapView. . . . .
Help now. . . . . . . . . . .