I am using a dictionary with parameters to send to a web service. I keep getting memory leaks from it, altho I do a release for the object. My code:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
// getting an NSString
NSString *clientID = [prefs stringForKey:@"ClientID"];
//Call web service
id delegate1 = self;
AsyncWebServiceController * webService = [[[AsyncWebServiceController alloc] initWithDelegate:delegate1
selSucceeded:@selector(webServiceConnectionSucceeded:)
selFailed:@selector(webServiceconnectionFailed:)] autorelease];
NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; //Memory leak here
[params setValue:clientID forKey:@"clientId"]; //Memory leak here
[params setValue:[self.jobDetails objectForKey:@"BoardId"] forKey:@"jobBoardId"];
[params setValue:[self.jobDetails objectForKey:@"Id"] forKey:@"jobId"];
[webService startRequest:@"JobReviewGet" parameters:params];
[params release];
Any ideas? Thanks!!
Are you releasing your webService object at some point? Also is the delegate of AsyncWebServiceController an assigned or retained property? Delegates should generally be assigned properties to avoid retain loops.