1
在我的应用程序中,我使用NSRunAlertPanel来确认用户退出。NSRunAlertPanel导致内存泄漏
当我在仪器下运行我的应用程序来检测内存泄漏时,它会在下面的代码中显示内存泄漏。
-(void)CloseWithConfirm
{
int answer;
//Here, it is showing memory leak.
answer = NSRunAlertPanel (@"Quit Confirmation", @"Do you want to quit?", @"Yes", @"No", @"Cancel");
if(NSAlertDefaultReturn == answer)
[self close];
}
任何线索吗?
苹果没有使用[NSApp stopModal];在那里有示例项目。 –
感谢MySpecialPurpose的答案。看起来这个内存泄漏现在已经消失了。 – doptimusprime