You really need to review iPhone memory rules. For example
+(NSString *) urlDecode: (NSString *) url
{
NSString *result=[url stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return [result autorelease];
}
The result of stringByReplacingPercentEscapesUsingEncoding is already autoreleased and you are autoreleasing it again.
On the return, you do this:
[cardTypeDTO setImageURL:[[CommonUtility urlDecode:[cardDetail objectForKey:@"imageURL"]] retain]]
is setImageUrl a synthesized retain @property? If so, it already calls retain.
cardTypeDTO
has retainCount 1 and then is added to a dictionary that retains it (setValue calls setObject, which sends retain).
I wrote this, which might help:
http://loufranco.com/blog/files/managing-memory-iphone.html
There is also a link there to another good explanation.