仪器告诉我这个代码泄漏了。哪里?我必须释放conn吗?
- (void)loadFeatureXML:(id<BPLFeatureLoaderDelegate>)delegate {
_delegate = delegate;
NSURLConnection *conn;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.myxmlfeed"]];
if ([NSURLConnection canHandleRequest:request]) {
conn = [NSURLConnection connectionWithRequest:request delegate:self];
if (conn) {
self.featureXMLData = [NSMutableData data];
}
}
}
答案 0 :(得分:1)
我最好的猜测是你泄漏了代表;为什么不:
self._delegate = delegate;
就像下面的self.featureXMLData
一样?