Hi,
I have 3 view controllers that call the same class to parse an RSS feed. Using the performance tool, Leaks, and viewing instruments I see that all 3 view controllers leak at the exact same line: [[self rssParser]startProcess]; (see below)
**Edit: I should mention that there is a fourth view controller that calls [[self rssParser]startProcess]; with the same code. That view controller does not leak and it is the first one that calls [[self rssParser]startProcess]; when the app launches.
- (void)viewDidLoad {
[super viewDidLoad];
[self toolbarInit];
_rssParser = [[BlogRssParser alloc]init];
self.rssParser.delegate = self;
self.rssParser.segInt = [NSNumber numberWithInt: self.currentMode];
[[self rssParser]startProcess]; // !! Leaking Here !!
}
Each of the views dealloc rssParser:
- (void)dealloc {
[_rssParser release];
[super dealloc];
}
Here is the header file for the BlogRssParser class that is being called:
#import <Foundation/Foundation.h>
@class BlogRss;
@protocol BlogRssParserDelegate;
@interface BlogRssParser : NSObject {
BlogRss * _currentItem;
NSMutableString * _currentItemValue;
NSMutableArray * _rssItems;
id<BlogRssParserDelegate> _delegate;
NSOperationQueue *_retrieverQueue;
}
@property(nonatomic, retain) BlogRss * currentItem;
@property(nonatomic, retain) NSMutableString * currentItemValue;
@property(readonly) NSMutableArray * rssItems;
@property(nonatomic, assign) id<BlogRssParserDelegate> delegate;
@property(nonatomic, retain) NSOperationQueue *retrieverQueue;
- (void)startProcess;
@end
Here is the implementation file for the relevant startProcess method in BlogRssParser:
- (void)startProcess{
SEL method = @selector(fetchAndParseRss);
[[self rssItems] removeAllObjects];
NSInvocationOperation *op = [[NSInvocationOperation alloc] initWithTarget:self
selector:method
object:nil];
[self.retrieverQueue addOperation:op];
[op release];
}
Any help suggestions are appreciated.