I'm parsing an XML string and have a memory leak. I know this code is leaking, but not sure what the fix is:
Code like this appears to be fundamentally flawed:
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)value{
if ([currentElement isEqualToString:@"problem_id"]){
currentProblem.problemId = [[value copy] intValue];
} else if ([currentElement isEqualToString:@"rule_instance_id"]){
currentProblem.ruleInstanceId = [value copy];
} else if ([currentElement isEqualToString:@"description"]){
currentProblem.desc = [value copy];
} else if ([currentElement isEqualToString:@"name"]){
currentProblem.name = [value copy];
but not sure how I should deal with grabbing the found characters and retaining/releasing them.
thanks