被释放的指针未分配。 iOS 4 有问题但 iOS 5 没有问题?
我试图在 iOS 5 beta iPhone 上开发一个应用程序,代码可以正常运行,但当我尝试将相同的应用程序编译到 iOS 4.3.3 设备时,我遇到了一个错误“指针被释放不是分配”。
我在网上搜索解决方案,显然这是一些与很快释放对象的链接,但我什至在释放任何对象之前就崩溃了。其他一些开发者在 iOS 4 上测试时也遇到了同样的错误,但在 iOS 3.2 上却没有。
有什么想法吗?还有什么解决方案吗?
谢谢:)
劳伦斯
I was trying to develop an app on an iOS 5 beta iPhone and the code could be run with no errors but while I was trying to compile the same apps to and iOS 4.3.3 device, I encountered an error "pointer being freed was not allocated".
I searched the web for solutions and apparently it was something link to releasing an object to soon but I crashed even before I released any object. Some other developers also encountered the same error when testing on iOS 4 but not in iOS 3.2.
Any thoughts on what's wrong with it? and also anything solutions to that?
Thanks:)
Lawrence
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Xcode 4.2 包含一个更好的编译器,它可以帮助您发现比旧编译器指出的更多内存管理错误。这是因为要实现 ARC,他们需要进行更深入的静态代码分析。通常情况下,程序崩溃的位置与原始错误发生的位置不同。我在这里列出了一些如何解决此类问题的想法:过渡到 iOS 5 时要注意什么 。
Xcode 4.2 includes a much better compiler that will help you find even more memory management errors than the old compiler would point out for you. This is because to implement ARC they needed to do deeper static code analysis. It is often the case the where your program crashes is different from where the original error occurred. I've listed some ideas for how to attack this kind of problem here: What to watch out for when transitioning to iOS 5.