NSMutableArray *lCellColValues =(NSMutableArray *)nil;
lCellColValues = [[[NSMutableArray alloc] init] autorelease];
if(0 == lSecModulus) //trans info cell
{
if cObjTransListPtr.count >0 && lObjTransData.m_cObjSDElemInfoPtr.count > 0 )
{
[lCellColValues addObject:lObjTransData.m_cObjTransNamePtr];
[lCellColValues addObject:[[NSNumber numberWithInteger:lObjTransData.m_cTransCounter] stringValue]];
}else {
if (nil != lObjSDElemInfo.m_cObjStartTimePtr)
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"HH:mm:ss";
[dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0.0]];
NSString *myDateAsString = [dateFormatter stringFromDate:lObjSDElemInfo.m_cObjEndTimePtr];
[lCellColValues addObject:myDateAsString];
SAFE_RELEASE(dateFormatter)
}else{
[lCellColValues addObject:@""];
}
[lCellColValues addObject:[[NSNumber numberWithDouble:lObjSDElemInfo.m_cElementTime] stringValue]];
}
}
if((CustSplitCell *)nil == lObjCellPtr){
if (m_cObjTransListPtr.count > 0) {
lObjCellPtr = [[[CustSplitCell alloc]initWithStyleAndTitles:UITableViewCellStyleDefault reuseIdentifier:lObjCellIdentifier titles:lCellColValues rowNumber:indexPath.row] autorelease];
}else {
[lCellColValues addObject:@""];
lObjCellPtr = [[[CustSplitCell alloc]initWithStyleAndTitles:UITableViewCellStyleDefault reuseIdentifier:lObjCellIdentifier titles:lCellColValues rowNumber:indexPath.row] autorelease];
}
}
In this code lCellColValues is leaking memory even if we autorelease it. Any idea why it is showing leak??
Try this:
it will automatically allocated and release.