开发者

instruments xcode4 not working?

Im following Ray Wenderlich tutorial for instruments, but I don't know why the profiling is not showing the leaked object??

- (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 
                                          otherB开发者_C百科uttonTitles:@"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];
}

Im using the code in the tutorial, and as you can see the alertView is leaking!

But I run it trough instruments leaks, and nothing appears! [also is very very very slow to acknowledge the stop button was pressed to stop the profiling!]

instruments xcode4 not working?

So what is missing??,

thanks a lot!


Frankly, I think it's a bug. Hopefully it'll be fixed soon (I'm using v4.1) but all is not lost. Under the Allocations instrument you can filter which types are displayed. In this image I've told it to show UIAlertView instances. After clicking in the UITableView a couple of times you can see it tells me that there are 2 instances living, which confirms that there is a leak.

instruments xcode4 not working?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜