首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >App在超级去合金化方法中崩溃

App在超级去合金化方法中崩溃
EN

Stack Overflow用户
提问于 2013-05-17 06:49:37
回答 7查看 2.2K关注 0票数 0

我的应用程序在[super dealloc];行和- (void)dealloc方法上崩溃,在该方法中,我要释放保留在.h类中的所有对象,崩溃报告是

代码语言:javascript
复制
-[__NSArrayI respondsToSelector:]: message sent to deallocated instance 0x86fb1a0
-[__NSArrayI respondsToSelector:]: message sent to deallocated instance 0x86fb1a0
-[__NSArrayI respondsToSelector:]: message sent to deallocated instance 0x86fb970
-[UIButton release]: message sent to deallocated instance 0x9b914b0

但是,当我阻止[super dealloc];时,会发生什么呢?这行代码工作得很好,但它给了我警告Method possibly missing [super dealloc] call。如果有人知道,请在我做错的地方帮助我。提前谢谢。

编辑的

代码语言:javascript
复制
 [_gf_Knowledge_ratingStars release];
[_gf_Range_ratingStars release];
[_quality_ratingStars release];
[_atmosphere_ratingStars release];
[_reviewtxt release];
[_whatsGoodHere release];
[_saveButton release];
[_screen_title release];
[_commentImageView release];
[_resturantBGImageView release];
[_textViewPlaceholder release];
[_gFKnowledgeUnselectBtn release];
[_gFRangeUnselectBtn release];
[_gualityUnselectBtn release];
[_atmosphereUnselectBtn release];
[_gFKnowledgeLbl release];
[_gFRangeLbl release];
[_gualityLbl release];
[_atmosphereLbl release];
[_navbarImageView release];
[_btnBack release];
[super dealloc];
EN

回答 7

Stack Overflow用户

回答已采纳

发布于 2013-05-17 06:54:35

我认为您正在使用NSArray静态方法将内存分配给arrayWithArray

通过这种方式,它将被添加到自动发布池中,并且保留计数将为0。要么保留它,要么手动使用alloc[[NSArray alloc] init]

票数 3
EN

Stack Overflow用户

发布于 2014-03-13 06:48:22

如果您两次释放一个对象,就会发生这种情况。请检查所有版本并删除任何副本。

票数 2
EN

Stack Overflow用户

发布于 2013-05-17 07:03:30

确保这一行([super dealloc];)是dealloc方法中的最后一条语句,我认为您在[super dealloc]之后已经为其他类变量编写了发行版

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16603088

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档