NSPlaceholderString内存泄漏与ARC

时间:2014-03-02 09:40:56

标签: ios objective-c cocoa-touch memory-leaks automatic-ref-counting

目前我使用ARC开发iOS应用程序。该应用程序是一个带有两个TableViewControllers的故事板应用程序。

问题是,在下列情况下,仪器会显示内存泄漏:

  

应用程序的开始 - > MainViewController已加载 - >按下主页按钮 - >出现本地通知 - >应用程序开始使用本地通知 - > AppDelegate获取导航控制器 - >在MainViewController中调用函数,它加载2. View Controller - > 2.显示View Controller,用户点击“Back”。

此时仪器显示内存泄漏:

Leaked Object | # | Address   | Size     | Responsible Library | ResponsibleFrame
__NSCFString  | 1 | 0xe40dd30 | 32 Bytes | Foundation          | -[NSPlaceholderString initWithFormat:locale:arguments:]

当我查看堆栈跟踪时,我看不到任何自己的功能。

我在编程中是否犯了错误,或者这是Apple Framework中的错误。

如何避免这个问题?

The Stack Trace

2 个答案:

答案 0 :(得分:5)

我收到了NSPlaceholderString的这种泄漏。但是你可以忽略它,因为Apple Framework只泄漏了32个字节。

答案 1 :(得分:1)

要检查任何不平衡的保留/释放,请运行

Product> Analyze shift + + B )。

如果不返回任何内容,可能无法做任何事情。