Hi Guys,
I am getting allocation count plus one in the below code.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"MasterViewIdentifier"] autorelease];
cell.accessoryType = UITableViewCellAccessoryNone;
cell.selectionStyle = UITableViewCellEditingStyleNone;
UIView* elementView = [ [UIView alloc] initWithFrame:CGRectMake(5,5,312,480)];
elementView.tag = 0;
[cell.contentView addSubview:elementView];
[elementView release];
}
UIView* elementView = [cell.contentView viewWithTag:0];
for(UIView* subView in elementView.subviews)
{
[subView removeFromSuperview];
}
if(indexPath.section==0)
{
if(indexPath.row==0)
{
// i have tried like this but getting exception.
/*
UIImage *cellBackImag=[UIImage imageNamed:@"celltop.png" ];
UIImageView* imaeView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 300, 43)];
imaeView.image=cellBackImag;
[elementView addSubview:imaeView];
[imaeView release];
[cellBackImag release];
*/
// here I am getting uiimage count allocation count
UIImageView* imaeView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"celltop.png" ]];
imaeView.frame=CGRectMake(0, 0, 300, 43);
[elementView addSubview:imaeView];
[imaeView release];
Please help me out of this, Thank You, Madan Mohan