Application size with loading Apple MAP

╄→гoц情女王★ 提交于 2019-12-10 23:37:46

问题


I am struggling with a problem that looks like simple but it is making the app run size to 30-35 MB. The app is ARC enabled. Here is the scenario.

1) I invoke a UIViewcontroller from within my method (the viewController instance is local to the method)& after pushing it to NavigationController I am setting the local instance as nil.

    btMapViewController *routeMap = [[btMapViewController alloc]init];
        [routeMap setSourcLocation:[txtsource text]];
        [routeMap setDestinationLocation:[txtDestination text]];
        [routeMap setNightFareOn:addNightCharge];
        [self.navigationController pushViewController:routeMap animated:YES];
        routeMap = nil;

2) The newly pushed controller initializes a MKMapView & plot the routes on it. The app now runs on a memory of 35-40 MB which is 5 times more than what it was running before step 1.

@interface btMapViewController ()
@property(nonatomic, strong) MKMapView *mapView;
@end

3) Now if I pop out the UIViewcontroller (the one loaded in step 1), the app runs on a memory of 30-34 MB.

I check the Memory trace, its clear. Then who is holding the memory ?

Is that the MKMap is the part of Interface Implementation is leading to this problem or shall I make it private to the btMapViewController class. ?

来源:https://stackoverflow.com/questions/19419665/application-size-with-loading-apple-map

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!