Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableViewCell custom initialization from nib
    text
    copied!<p>How wrong could it be the code bellow:</p> <pre><code>- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { NSArray *array = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]; for (id currentObject in array) { if ([currentObject isKindOfClass:[self class]]) { self = [currentObject retain]; } } return self; } </code></pre> <p>I'm trying to bring up a custom UITableViewCell from nib file, the problem is that Leaks Instruments says there's a leak inside:</p> <pre><code> - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; CPVideoGenTVCell *cell = (CPVideoGenTVCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[CPVideoGenTVCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.delegate = self; cell.titleLbl.textColor = [UIColor colorWithRed:0.992 green:0.933 blue:0.0 alpha:1.0]; } CPTempVideo *aVideo = [self.videos objectAtIndex:indexPath.row]; cell.seasonLbl.text = [NSString stringWithFormat:@"Season %@", [self romanNumberFromArabic:aVideo.season]]; cell.titleLbl.text = [NSString stringWithFormat:@"%2i - \"%@\"",aVideo.idVideo, aVideo.chapterName]; cell.managedImg.url = aVideo.thumbnail; [[CPDataManager sharedDataManager] manageImage:cell.managedImg]; return cell; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload