這是我的第一篇文章,所以我希望格式化可以。內存泄漏:在線分配的對象的潛在泄漏
我得到這個泄漏「上線的對象的潛在泄漏」,我無法弄清楚。也許我太看重它,因此我看不到問題。有人可以幫我嗎?
該生產線的問題是:appDelegate.imageText
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
PListFirstAppDelegate *appDelegate = (PListFirstAppDelegate *)[[UIApplication sharedApplication]delegate];
appDelegate.imageText= [[NSString alloc]initWithFormat:@"%@",[[array objectAtIndex:indexPath.row]objectForKey:@"image"]];
//NSLog(@"%@", appDelegate.imageText);
NavigationalDescription *detailViewController = [[NavigationalDescription alloc] initWithNibName:@"NavigationalDescription" bundle:nil];
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
感謝這個工作替換代碼。 – user1309075 2012-10-08 16:56:27
很高興它的工作,你應該接受一個答案供他人以後參考。 – rooftop 2012-10-08 18:17:01