Leak when I load custom UITableViewCells from Xib files?

I am getting leak in following code. Leak percentage @ the end of the line. Can anyone tell me what is the problem.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

coustomMessage *cell = (coustomMessage *)[tableView dequeueReusableCellWithIdentifier:@"coustomMessage"];
if (cell == nil) {
    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"coustomMessage" owner:self options:nil]; (93.1%)
    cell = [topLevelObjects objectAtIndex:0];
}

cell.nameLable.text = [self.nameArray objectAtIndex:indexPath.row]; (3.4%)
cell.messageStatusLable.text = [[self.endPointCountArray objectAtIndex:indexPath.row] stringValue]; (3.4%)

return cell;}

Answers


are you sure you setted the "identifier" property in your XIB file with the same name you use in your code (with: dequeueReusableCellWithIdentifier:@"coustomMessage")?


Superb! I had exactly the same issue I misspelled the identifier in the XIB and so lots of leaks as the cell we being recreated not re-used. Thanks!


Need Your Help

MVC 3.0 ModelBinder bindingContext.ValueProvider.GetValue(key) returns null when binding in a collection

c# asp.net-mvc modelbinder

I am new using custom ModelBinders, I have been looking around and I couldn't find any post related to this specific case.

How to get restlet to follow 301 redirects

java google-app-engine restlet http-redirect

I am currently trying to get a resource which could be behind possible more than one redirect. My code looks like this: