使用单例时Xcode静态分析仪的性能(Xcode static analyzer performance when using singletons)
我无法理解XCode中的静态分析器如何识别涉及单例的可能泄漏。 在下面的代码中,我收到警告,第一行和第一个return语句中可能存在泄漏。 分析器将这些警告放在第二个返回语句中。 由于我在这些行中没有进行分配,我认为它是对单例的访问,以及它可能的分配,这导致了这个警告。 任何人都可以向我解释静态分析仪在这里发生了什么?
if ((self.tableView.editing & ([[[[GroupList sharedGroupList] newGroup] linkArray] count] < [[GrazeConstants sharedGrazeConstants] maxLinksPerGroup])) | (([[[[GroupList sharedGroupList] newGroup] linkArray] count] == 0) & !self.tableView.editing)) { return ([[[[GroupList sharedGroupList] newGroup] linkArray] count]+1); } else { return ([[[[GroupList sharedGroupList] newGroup] linkArray] count]); }
I'm having trouble understanding how the static analyzer in XCode is identifying possible leaks that involve singletons. In the code below, I get warned that there is a possible leak in the first line, and also in the first return statement. The analyzer places these warnings on the second return statement. Since I'm doing no allocations in these lines, I assume it is the access to the singleton, and its possible allocation, that is causing this warning. Can anyone explain to me what is going on here with the static analyzer?
if ((self.tableView.editing & ([[[[GroupList sharedGroupList] newGroup] linkArray] count] < [[GrazeConstants sharedGrazeConstants] maxLinksPerGroup])) | (([[[[GroupList sharedGroupList] newGroup] linkArray] count] == 0) & !self.tableView.editing)) { return ([[[[GroupList sharedGroupList] newGroup] linkArray] count]+1); } else { return ([[[[GroupList sharedGroupList] newGroup] linkArray] count]); }
原文:https://stackoverflow.com/questions/6713524
最满意答案
上周问题已经解决了。
我删除了我的项目并从服务器中检出。 事情已经完成。
Problem had been solved last week.
I delete my project and check it out from server. Things get done.
相关问答
更多-
什么是flex?[2022-03-10]
flex是一种技术,也可以说是一种框架,就是做网页特效的 -
什么是AS和flex[2023-07-12]
AS(ActionScript) 动作脚本是遵循 ECMAscript第四版 的 Adobe Flash Player 运行时环境的编程语言。它在 Flash 内容和应用程序中实现交互性、数据处理、以及其他功能。 flex通常是指Adobe Flex,是最初由Macromedia公司在2004年3月发布的,基于其专有的Macromedia Flash平台,它是涵盖了支持RIA(Rich Internet Applications)的开发和部署的一系列技术组合。Flex 是一个高效、免费的开放源框架,可用于构 ... -
像这样busy.visible = true; Like this busy.visible = true;
-
面向对象的知识是必须的。 所以很好的问题是: 多态性 遗产 封装 我想到的一些主要概念: 事件处理,自定义事件 调用服务器端代码 集合 异常处理,日志记录,调试 浏览器导航支持 关于Java - Java知识在面向对象方面是一个优点,但Java经验让我期望Flex能够成为Java,事实并非如此,这可能会带来一些困难。 Object-oriented knowledge is a must. So good questions would be about: polymorphism inheritance ...
-
首先,.profile文件:如果它不存在,只需创建它(如其他人所说),然后添加所需的任何内容。 这应该在你的主目录中(例如,/ /home/YourName/.profile你的/home/YourName/.profile )。 至于没有目标:在你安装SDK之后,你需要安装你想要的任何平台。 从文档 : Android SDK入门套件仅包含一个组件:最新版本的SDK工具。 该组件中包含一个名为Android SDK和AVD Manager的工具,您可以使用该工具从SDK存储库站点下载其他组件。 该工具提供 ...
-
上周问题已经解决了。 我删除了我的项目并从服务器中检出。 事情已经完成。 Problem had been solved last week. I delete my project and check it out from server. Things get done.
-
Delphi XE5 Android开发。(Delphi XE5 Android development. How to set CPU Architecture (ABI) in APK)[2020-12-17]
Delphi已经使用armeabi-v7a并且不支持ARMv6。 话虽这么说,有一个已知的armeabi / armeabi-v7a不兼容性,阻止Delphi APK在某些设备上正确加载: QC#119786 Delphi already uses armeabi-v7a and does not support ARMv6. That being said, there is a known armeabi/armeabi-v7a incompatibility that prevents Delphi ... -
是的,当然,您需要的是一个用于序列化对象表单和PHP和ActionScript 3的远程桥接器。在这里查找AMFPHP http://www.silexlabs.org/amfphp/ Yes of course, what you need is a remoting bridge to serialize object form and to PHP and ActionScript 3. Look for AMFPHP here http://www.silexlabs.org/amfphp/
-
确实适用于FB 4.6。 对于TitleBar,只需使用spark.skins.mobile.ViewNavigatorSkin做同样的技巧:-) Works fine with FB 4.6 indeed. For TitleBar, just do the same kind of trick with spark.skins.mobile.ViewNavigatorSkin :-)
-
您始终可以在Firefox中查看XML文件,或使用FlashDevelop打开XML。 这两个都是免费资源,可以让您查看是否有任何错误。 我喜欢Firefox,因为它一次只显示一个错误,而且行号非常清楚。 FlashDevelop有一个工具可以将XML重新格式化为结构良好的布局(菜单项Refactor | Code Formatter )。 但是,为了帮助解决您的具体问题,让我们参考错误消息: [...]EmployeeDirectory-app.xml(219): error 105: applicati ...