在操作仪器时,将存储信息从以下线上泄露出来,“(NSString *)编码”是指从服务器上抽取的“JSON”反应器,扫描任何给器,并了解如何固定这种记忆的泄漏,
Thanks, Sam,
www.un.org/Depts/DGACM/index_spanish.htm
NSMutableDictionary *allCards = [NSMutableDictionary dictionary];
CardTypeDTO *cardTypeDTO = [[CardTypeDTO alloc] init];
[cardTypeDTO setImageURL:[[CommonUtility urlDecode:[cardDetail objectForKey:@"imageURL"]] retain]];
[allCards setValue:cardTypeDTO forKey:[cardDetail objectForKey:@"accountId"]];
-(id)parseFeed:(NSString *)feedString{
//NSMutableDictionary *allCards = [[NSMutableDictionary alloc] init];
NSMutableDictionary *allCards = [NSMutableDictionary dictionary];
NSMutableDictionary *parsedOutput = (NSMutableDictionary *)feedString;
NSArray *objectKeys = [parsedOutput allKeys];
for (int i = 0; i < [objectKeys count]; i++) {
NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init];
NSMutableDictionary *cardDetail = [parsedOutput objectForKey:[objectKeys objectAtIndex:i]];
CardTypeDTO *cardTypeDTO = [[CardTypeDTO alloc] init];
[cardTypeDTO setAccountId:[cardDetail objectForKey:@"accountId"]];
[cardTypeDTO setCardName:[cardDetail objectForKey:@"cardName"]];
[cardTypeDTO setBankName:[cardDetail objectForKey:@"bankName"]];
[cardTypeDTO setCustomMessage:[cardDetail objectForKey:@"customMessage"]];
[cardTypeDTO setAvailableAmount:[cardDetail objectForKey:@"availableAmount"]];
[cardTypeDTO setBalanceAmount:[cardDetail objectForKey:@"balanceAmount"]];
[cardTypeDTO setPercentage:[cardDetail objectForKey:@"percentage"]];
//[cardTypeDTO setImageURL:[cardDetail objectForKey:@"imageURL"]];
[cardTypeDTO setImageURL:[[CommonUtility urlDecode:[cardDetail objectForKey:@"imageURL"]] retain]];
[cardTypeDTO setNickName:[cardDetail objectForKey:@"nickName"]];
[cardTypeDTO setBalanceStatusCode:[cardDetail objectForKey:@"balanceStatusCode"]];
[cardTypeDTO setBalanceStatusMsg:[cardDetail objectForKey:@"balanceStatusMsg"]];
[cardTypeDTO setOnlineLinked:[cardDetail objectForKey:@"onlineLinked"]];
[cardTypeDTO setCardType:[cardDetail objectForKey:@"cardType"]];
[allCards setValue:cardTypeDTO forKey:[cardDetail objectForKey:@"accountId"]];
//[cardTypeDTO release];
[loopPool release];
}
return allCards;
}
+(NSString *) urlDecode: (NSString *) url
{
NSString *result=[url stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return [result autorelease];
}