Can't find the leak in this Objective-C NSXMLParser code?
问题 I am new to iPhone programming, and am running my app against the Leaks tool in Instruments. The tool is finding a few leaks, all of which seem to point to 1 line of code in a class which uses NSXMLParser: - (BOOL)parse{ NSURL *url = [[NSURL alloc] initWithString:@"[url here]"]; NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url]; [parser setDelegate:self]; NSLog(@"NSXMLParser initialized"); [parser parse]; [url release]; [parser release]; return YES; } The tool points to