析构函数运行时崩溃

时间:2013-04-11 18:15:14

标签: iphone objective-c crash destructor

尝试重新加载之前加载的视图控制器时,我的应用程序崩溃。

在MySecondViewController的界面中,我有一个属性是MyCustomClass的一个实例:

@interface MySecondViewController ()

@property (nonatomic, retain) MyCustomClass *myClassInstance;

@end

当我在导航控制器中按Back并返回到MyFirstViewController,然后尝试重新加载MySecondViewController时,我在MyCustomClass的dealloc方法中崩溃了。堆栈详细说明如下:

0 objc_release
1 -[MyCustomClass .cxx_destruct]
2 object_cxxDestructFromClass(objc_object*, objc_class*)
4 object_dispose
5 -[MyCustomClass dealloc]
6 -[MySecondViewController .cxx_destruct]

似乎是因为,在其他地方,我存储了一个指向MySecondViewController的指针,当该指针试图重置为MySecondViewController的新实例时,会抛出错误。

MyCustomClass看起来像这样:

@interface MyCustomClass () {

int _myInt;

}

@property (readwrite) AUGraph   processingGraph;
@property (readwrite) MusicPlayer player;

@end

@implementation MyCustomClass

@synthesize processingGraph     = _processingGraph;

有什么明显的东西我做错了导致这次崩溃吗?

0 个答案:

没有答案