我的应用程序在[super dealloc];行和- (void)dealloc方法上崩溃,在该方法中,我要释放保留在.h类中的所有对象,崩溃报告是
-[__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。如果有人知道,请在我做错的地方帮助我。提前谢谢。
编辑的
[_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];发布于 2013-05-17 06:54:35
我认为您正在使用NSArray静态方法将内存分配给arrayWithArray。
通过这种方式,它将被添加到自动发布池中,并且保留计数将为0。要么保留它,要么手动使用alloc和[[NSArray alloc] init]
发布于 2014-03-13 06:48:22
如果您两次释放一个对象,就会发生这种情况。请检查所有版本并删除任何副本。
发布于 2013-05-17 07:03:30
确保这一行([super dealloc];)是dealloc方法中的最后一条语句,我认为您在[super dealloc]之后已经为其他类变量编写了发行版
https://stackoverflow.com/questions/16603088
复制相似问题