Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zerocustom1989

macrumors regular
Original poster
Sep 5, 2007
247
22
I'm unsure how to implement this properly in my code.

All of my table cells when they dont have images dont cause leaks, but with images on them leaks get shot out everywhere.

I add the images to the cells via interface builder and since they're static images I dont bother to declare them as an IBoutlet or set their properties etc.

I use the following code to set the cell:

Code:
static NSString *semesterCellIdentifier = @"SemesterCellIdentifier";
     
     SemesterTableViewCell *semesterCell = (SemesterTableViewCell *)[tableView dequeueReusableCellWithIdentifier:semesterCellIdentifier];
     if(semesterCell == nil){
          NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SemesterTableViewCell" owner:self options:nil];
          for(id oneObject in nib)
               if([oneObject isKindOfClass:[SemesterTableViewCell class]])
                    semesterCell = (SemesterTableViewCell *)oneObject;
     }
     //configure the cell.
     [self configureCell:semesterCell atIndexPath:indexPath];
     return semesterCell;

Have I dont something wrong in handling the images? Should IB take care of it cause they're static and just inside the .xib?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.