As i have finished my iOS App and was removing the memory leaks, I found that instrument was showing leak while assigning the values to it.
In the .h file i have declared the NSdictionary feedData with the property(nonatomic, retain).
I have one more class WebServiceController which returs the NSdictionary.
Here is my code. In the .m file
if ([nid rangeOfString:@","].location == NSNotFound)
{
NSArray *data = [[NSArray alloc]initWithObjects:nid,[NSNumber numberWithInt:0],[NSNumber numberWithInt:0],delegate1.myCity,nil];
WebServiceController *wsct=[[WebServiceController alloc]init];
wsct.delegate=[[UIApplication sharedApplication]delegate];
feedData=[wsct getTimelineFeed:data];
NSLog(@"feed data is--->%@",feedData);
[wsct release];
}
The code "feedData=[wsct getTimelineFeed:data];" is giving memory leak.
here is the function that is returning the NSDictionary.
-(NSDictionary*)MyTimelineFeed:(NSArray*)data
{
if(![delegate sessionId] ) return nil;
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithHost:[NSURL URLWithString:ENDPOINT]];
NSMutableArray * postParams = [NSMutableArray array];
NSString * method = [NSString stringWithFormat:@"timeline.getFeedItems"];
[postParams addObject:[delegate sessionId] ];
for (int i = 0; i < [data count]; i++) {
[postParams addObject:[data objectAtIndex:i]];
}
[request setMethod:method withObject:postParams];
XMLRPCResponse *nodeSaveResponse = [XMLRPCConnection sendSynchronousXMLRPCRequest:request];
[request release];
if([nodeSaveResponse isKindOfClass:[NSError class]])
return nil;
NSMutableDictionary * dict = [nodeSaveResponse object];
if ([dict isKindOfClass:[NSError class]]) {
//NSLog(@"Error found");
return nil;
}
return dict;
}
pls help.