简体   繁体   English

NSPlaceholderString内存泄漏与ARC

[英]NSPlaceholderString Memory Leak with ARC

at the moment I develop a iOS App with ARC. 目前我用ARC开发了一个iOS应用程序。 The app is a storyboard application with two TableViewControllers. 该应用程序是一个带有两个TableViewControllers的故事板应用程序。

The problem is, that instruments shows me a memory leak in the following case: 问题是,在下列情况下,仪器显示内存泄漏:

Start of the Application --> MainViewController loaded --> Home Button is pressed --> Local Notification appears --> App starts using the local notification --> AppDelegate get the navigation controller --> Calls function in MainViewController which load the 2. View Controller --> 2. View Controller is shown and User clicks on "Back". 启动应用程序 - > MainViewController加载 - >按Home键 - >出现本地通知 - > App开始使用本地通知 - > AppDelegate获取导航控制器 - > MainViewController中的调用函数加载2 .View Controller - > 2.显示View Controller,用户点击“Back”。

At this point instruments shows me a memory leak: 此时仪器显示内存泄漏:

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

When I look into the Stack Trace I can't see any of my own function. 当我查看堆栈跟踪时,我看不到任何自己的功能。

Did I make an mistake in my programming or is this a bug in the Apple Framework. 我在编程中是否犯了错误,或者这是Apple Framework中的错误。

How can avoid the problem? 怎么能避免这个问题?

堆栈跟踪

I have received this kind of Leaks for NSPlaceholderString . 我收到了NSPlaceholderString的这种泄漏。 But you can ignore that as it leaks because of Apple Framework and its of only 32 bytes . 但是你可以忽略它,因为Apple Framework只泄漏了32个字节。

To check for any unbalanced retain/releases, run 要检查任何不平衡的保留/释放,请运行

Product > Analyze ( shift + + B ). Product > Analyzeshift + + B )。

If that returns nothing, probably nothing you can do. 如果没有返回任何东西,可能你无能为力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM