Итак, после многих устаревших отладок комментариев, чтобы уменьшить утечку инструментов. Утечка происходит, когда я помещаю новый TableViewController в стек.
Я обнаружил, что получаю утечку из этого кода:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
if(![feedData isFinishedLoading]){
[[cell textLabel] setText:@"Loading..."];
[[cell detailTextLabel] setText:@"..."];
}
else{
NSDictionary *dict = [[feedData items] objectAtIndex:indexPath.row];
[[cell textLabel] setText:[dict valueForKey:@"title"]];
[[cell detailTextLabel] setText:[dict valueForKey:@"description"]];
[cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
}
return cell;
}
Эта версия не пропускает:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
// if(![feedData isFinishedLoading]){
// [[cell textLabel] setText:@"Loading..."];
// [[cell detailTextLabel] setText:@"..."];
// }
// else{
// NSDictionary *dict = [[feedData items] objectAtIndex:indexPath.row];
// [[cell textLabel] setText:[dict valueForKey:@"title"]];
// [[cell detailTextLabel] setText:[dict valueForKey:@"description"]];
// [cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
// }
return cell;
}
Эта версия делает:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell;
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
// if(![feedData isFinishedLoading]){
[[cell textLabel] setText:@"Loading..."];
[[cell detailTextLabel] setText:@"..."];
// }
// else{
// NSDictionary *dict = [[feedData items] objectAtIndex:indexPath.row];
// [[cell textLabel] setText:[dict valueForKey:@"title"]];
// [[cell detailTextLabel] setText:[dict valueForKey:@"description"]];
// [cell setAccessoryType:UITableViewCellAccessoryDetailDisclosureButton];
// }
return cell;
}
Вот крышка экрана инструментов:
![http://imgur.com/YR8k8](https://i.stack.imgur.com/3qqrg.png)
Проблема в моем коде где-то? Или это ошибка в фреймворке / симуляторе?