0
Im关注Ray Wenderlich tutorial for instruments,但我不知道为什么profiling未显示泄漏的对象?文书xcode4不工作?
- (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漏水!
但我运行它槽仪器泄漏,并没有出现! [也就是非常非常非常缓慢承认停止按钮被按下停止剖析!]
所以缺什么?,
非常感谢!
我在xcode 4.2中有一些bug。一个我得到很多是程序变得没有反应,并继续运行;我最终使用强制退出。 – geminiCoder
是的,我也在4.1中看到过。 – Martin
和Xcode 3.x ...我已经习惯了创建类静态的习惯来计算totalNumberAllocated和remainingInstances以及一个宏,以便在dealloc方法中记录(或不),作为调试的函数级别我设置为编译开关。跟踪这些速度要快得多。 – YvesLeBorg