簡體   English   中英

儀器xcode4無法正常工作?

[英]instruments xcode4 not working?

我正在遵循Ray Wenderlich 的樂器教程 ,但是我不知道為什么分析沒有顯示泄漏的對象?

- (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正在泄漏!

但是我通過儀器泄漏來運行它,什么也沒出現! [確認停止按鈕被按下以停止分析也非常非常非常慢!]

未檢測到泄漏

那么還缺少什么呢?,

非常感謝!

坦白說,我認為這是一個錯誤。 希望它會盡快修復(我正在使用v4.1),但不會丟失所有內容。 在分配工具下,您可以過濾顯示的類型。 在此圖中,我告訴它顯示UIAlertView實例。 在UITableView中單擊幾次后,您可以看到它告訴我有2個實例正在運行,這表明存在泄漏。

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM