iphone - 使用 iPhone 应用程序中的 Instruments 跟踪内存泄漏

标签 iphone memory-management memory-leaks

我在使用 Instruments 查找内存泄漏时遇到问题。通常它对我有很大帮助,我能够找到泄漏点,但在这种情况下我迷失了。

我正在创建一个 View Controller 来控制从 NIB 文件加载的 View 。该 View 具有“显示用户位置”为 true 的 map View 。找到用户位置后,我使用 MKReverseGeocoder 来获取位置数据。当我加载此 View Controller 并且 MapKit 找到用户位置时,泄漏始终存在。我发现 MKReverseGeocoder 在这里不是问题,因为无论有没有 MKReverseGeocoder,我都会遇到相同的泄漏。

当我加载此 View 时,仪器“泄漏”报告内存泄漏。请参阅图像上的屏幕截图: alt text

这就是我初始化 Controller 的方式:

AddPlaceViewController *addPlaceVC = [[AddPlaceViewController alloc] initWithNibName:@"AddPlaceViewController" bundle:[NSBundle mainBundle]];
addPlaceVC.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addPlaceVC];
self.placeController = navigationController;
[self presentModalViewController:self.placeController animated:YES];
[addPlaceVC release];
[navigationController release];

这一切都在 iPhone Simulator 4 和目标操作系统 3.2 上。

这实际上是泄漏还是我在这里面临的问题?

最佳答案

由于负责的库是“Foundation”而不是您的代码,因此您对此无能为力(除了向 Apple 报告之外)。

关于iphone - 使用 iPhone 应用程序中的 Instruments 跟踪内存泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3279950/

相关文章:

iphone - XCode 样板代码困惑,为什么要添加多次?

iphone - 检查以编程方式生成的 ImageView 的相交

objective-c - 多次调用 'release'?

c++ - 将内存池中的malloc和free替换为new和delete

linux - 什么是统一寻址内存?

python - 在循环中使用 numpy load 时内存溢出

iphone - 编译我的应用程序没有错误,但是在设备上编译时挂起

windows - "Out of memory"带有简单的 Win32::Unicode::File readline 循环和 Strawberry Perl

iphone - 内存问题: simulated memory warning/didReceiveMemoryWarning

ios - 代码签名错误: No profiles for app were found. 如何解决?