MKMapView टपकाया है

वोट
1

साथ ही मेरे सवाल के रूप में निकाल रहा है MKMapViewएनोटेशन लीक कारण बनता है। मुझे पता चला है कि अगर आप एक दृश्य के आधार पर प्रोजेक्ट बनाने, एक जोड़ने UISearchBarऔर MKMapViewदृश्य की निब में, तार ऊपर प्रतिनिधियों (जैसा कि हम वास्तव में लीक को गति प्रदान करने में कुछ भी करने की जरूरत नहीं है मैं किसी भी तरीकों बनाने नहीं कर रहा हूँ), में लिंक MapKit और परियोजना की आग, फिर बस पर क्लिक UISearchBarकारण एक 1k + रिसाव। यह जब तक आप दोनों नहीं होता है UISearchBarऔर MKMapViewएक दृश्य में। मैं जब कोड से दृश्य बनाने में एक ही मुद्दे हैं। मैंने सोचा था कि एक निब अलग ढंग से व्यवहार सकता है, लेकिन ऐसा नहीं है।

है MKMapViewटपकाया, या मैं कुछ गलत कर रहा हूँ।

कोड के साथ इस मुद्दे को दोहराने के लिए नीचे दिए गए कोड की कोशिश - मैं एक नया दृश्य आधारित अनुप्रयोग प्रोजेक्ट बनाया

TestMapViewFromCodeViewController.h

#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>

@interface TestMapViewFromCodeViewController : UIViewController {
    UISearchBar *searchBar;
    MKMapView *mapView;

}

@property (nonatomic, retain) MKMapView *mapView;
@property (nonatomic, retain) UISearchBar *searchBar;


@end

TestMapViewFromCodeViewController.m

- (void)viewDidLoad {
    [super viewDidLoad];
    UISearchBar * tmpSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0,0.0,self.view.frame.size.width,40.0)];
    [self.view addSubview:tmpSearchBar];
    [self setSearchBar:tmpSearchBar];
    [tmpSearchBar release];

    MKMapView *tmpMapView=[[MKMapView alloc] initWithFrame:CGRectMake(0.0,0.0,self.view.frame.size.width,self.view.frame.size.height)];
    tmpMapView.showsUserLocation=FALSE;
    [self.view insertSubview:tmpMapView atIndex:0];
    [self setMapView:tmpMapView];
    [tmpMapView release];
}


- (void)dealloc {
    [mapView release];
    [searchBar release];
    [super dealloc];
}

हालांकि मैं MapView और Searchbar साथ subviews बरकरार रखा गया है, यह शायद इस मुद्दे को दोहराने के लिए अनावश्यक है।

यहाँ प्रकाशित करने से पहले इस कोड को परीक्षण में मैं सिर्फ देखा है कि इस रिसाव सिम्युलेटर में नहीं होती है - केवल अपने फोन पर ...

03/09/2009 को 14:28
का स्रोत उपयोगकर्ता
अन्य भाषाओं में...                            


2 जवाब

वोट
2

हाँ।

वहाँ 3.0 के MKMapViews पर एक ज्ञात लीक है। रिसाव तब होता है जब आप MKMapView यह बाद में विज्ञप्ति में तय हो गई है पुनःआवंटन। वैकल्पिक हल के लिए एक एकल MKMapView है और यह पुन: उपयोग किया जा सके।

https://devforums.apple.com/message/129740#129740

04/11/2009 को 08:28
का स्रोत उपयोगकर्ता

22/07/2011 को 10:44
का स्रोत उपयोगकर्ता

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more