Hi!
I have a problem of memory warning in my app... it works perfect on simulator but crash after some operation on the device... I use instruments to look for memory leaks and I found some of them in the init method and getSubscriptionList of this class....
I can't solve!!!! Someone can help me?
thanks
This is the class
Code:
//
// GoogleReader.h
// A wrapper around Google Reader API
//
//
#import <Foundation/Foundation.h>
#import "SBJsonParser.h"
#import "GDataOAuthAuthentication.h"
#import "MWFeedParser.h"
#import "SubscriptionArray.h"
#import "CountingArrayClass.h"
#import "CategoryArray.h"
#define kAppServiceName @"Google Reader App"
@protocol GoogleReaderRequestDelegate<NSObject>
- (void)didFinishRequest;
- (void)GoogleReaderRequestDidFailWithError:(NSError *)error;
- (void)GoogleReaderRequestDidLoadJSON:(NSDictionary *)dict;
- (void)GoogleReaderRequestDidLoadFeed:(NSString *)feed;
- (void)GoogleReaderRequestReceiveBytes:(float)partial onTotal:(float)total;
@optional
- (void)GoogleReaderRequestDidAuthenticateWithUser:(NSDictionary *)userDict;
- (void)GoogleReaderRequestSendBytes:(float)partial onTotal:(float)total;
@end
@interface GoogleReader : NSObject <MWFeedParserDelegate>
{
// public delegate
id <GoogleReaderRequestDelegate> delegate;
// private
NSString *token;
SBJsonParser *JSON;
NSURLConnection *web;
NSHTTPURLResponse *response;
NSURLResponse *URLresponse;
NSMutableDictionary *headerArgs;
NSMutableDictionary *getArgs;
NSMutableDictionary *postArgs;
NSError *error;
NSError *JSONerror;
NSMutableData *responseData;
NSData *staticResponseData;
NSNumber *expectedResponseLength;
GDataOAuthAuthentication *oauthAuthentication;
NSMutableArray *feedItems;
BOOL requiresAuthentication;
NSMutableArray *subscriptions;
}
@property(nonatomic, retain) NSURLConnection *web;
@property(nonatomic, retain) NSMutableData *responseData;
@property(nonatomic, retain) GDataOAuthAuthentication *oauthAuthentication;
@property(nonatomic, readonly) NSArray *feedItems;
@property(readonly) BOOL requiresAuthentication;
@property(nonatomic, retain) NSMutableArray *subscriptions;
// instance methods
- (id)init;
- (void)setDelegate:(id)d;
// low level api methods
- (void)getAllFeeds;
- (void)getFeedWithFeedName:(NSString *)feedName orURL:(NSString *)url excludeTarget:(NSString *)exclude;
// medium level api methods
- (void)getPreference;
- (void)getSubscriptionsList;
- (void)getTagList;
- (void)getUnreadCountList;
// high level api methods
- (void)addSubscriptionWithURL:(NSString *)url feed:(NSString *)feed labels:(NSArray *)labels;
- (void)deleteSubscribptionWithFeedName:(NSString *)feed;
- (void)getUnreadItems:(int) max;
- (void)setUnread:(MWFeedItem *)entry;
- (void)setRead:(MWFeedItem *)entry;
- (void)addStar:(MWFeedItem *)entry;
- (void)deleteStar:(MWFeedItem *)entry;
- (void)addPublic:(NSString *)entry;
- (void)deletePublic:(NSString *)entry;
- (void)addLabel:(NSString *)label toEntry:(NSString *)entry;
- (void)deleteLabel:(NSString *)label toEntry:(NSString *)entry;
//ADDED
- (void)getSpecificFeedItems:(NSString *)url;
- (void)getRequestForCurrentUrl:(NSString *)url;
@end
and the implementation file is: