【发布时间】:2011-11-24 23:00:40
【问题描述】:
我关注 Ray Wenderlich tutorial for instruments,但我不知道为什么分析没有显示泄漏的对象??
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString * sushiName = [_sushiTypes objectAtIndex:indexPath.row];
NSString * sushiString = [NSString stringWithFormat:@"%d: %@", indexPath.row, sushiName];
NSString * message = [NSString stringWithFormat:@"Last sushi: %@. Cur sushi: %@", _lastSushiSelected, sushiString];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sushi Power!"
message:message
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:@"OK", nil];
[alertView show];
//_lastSushiSelected = sushiString; //el que jode, pues lo pone en string deallocada, por strinWithFormat que usa autorelease!
_lastSushiSelected = [sushiString retain];
//[alertView release];
}
我正在使用教程中的代码,你可以看到 alertView 正在泄漏!
但我通过仪器泄漏运行它,但什么也没有出现! [确认按下停止按钮以停止分析也非常非常慢!]
那么缺少什么??,
非常感谢!
【问题讨论】:
标签: ios memory-leaks xcode4 instruments