Iphone 转到上一个ViewController时应用程序崩溃

Iphone 转到上一个ViewController时应用程序崩溃,iphone,crash,Iphone,Crash,嗨,当我点击后退按钮时,我的iPhone应用程序正在崩溃。我真的不知道为什么会这样。您可以在图片中看到我的应用程序正在崩溃 我已经检查了我的按钮是否只与一个操作连接。所以我不知道到底是什么问题 如果我的问题愚蠢,那么请原谅我,我是iPhone开发新手,所以请帮助我 感染我正在使用打印机与设备,我认为有一些问题 CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.colors = [NSArray arrayWithObjec

嗨,当我点击后退按钮时,我的iPhone应用程序正在崩溃。我真的不知道为什么会这样。您可以在图片中看到我的应用程序正在崩溃

我已经检查了我的按钮是否只与一个操作连接。所以我不知道到底是什么问题

如果我的问题愚蠢,那么请原谅我,我是iPhone开发新手,所以请帮助我

感染我正在使用打印机与设备,我认为有一些问题

CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor colorWithRed:0.8 green:0.8 blue:1 alpha:1] CGColor],(id)[[UIColor colorWithRed:0.05 green:0.05 blue:0.38 alpha:255] CGColor], nil];

//creating the iEpsonCom objects
m_deviceParams = [[DeviceParameters alloc] init];
m_device = [[Device alloc] init];

//registering the callback
[m_device registerCallback:self withSelector:@selector(callbackMethod:)];

//creating a thread for regularly checking the connection state
m_Thread = [[ThreadClass alloc] init];
[m_Thread registerCallback:self withSelector:@selector(connectionStateThreadCallbackMethod:)];
[m_Thread setMilliseconds:300]; //check the connection state every 300 ms
[m_Thread start];             //start the thread

可能是您以前的视图控制器丢失了,因此首先检查您希望弹出到的控制器是否仍在视图控制器堆栈中

NSArray *arrView = [self.navigationController viewControllers];
NSLog(@"arrView %@",arrView);

如果在该堆栈中看不到要弹出到的视图控制器,则可能需要保留该控制器。也可能是您释放了太多,例如在
dealloc
方法中。

可能是您以前的视图控制器丢失,因此首先检查,您希望弹出的控制器是否仍在视图控制器堆栈中

NSArray *arrView = [self.navigationController viewControllers];
NSLog(@"arrView %@",arrView);

如果在该堆栈中看不到要弹出到的视图控制器,则可能需要保留该控制器。也可能是您释放了太多,例如在
dealloc
方法中。

您要解除的viewController的dealloc方法中发生了什么?可能您正在过度删除某些内容。如果您发布一些代码来设置显示/放弃此viewController,这也会有所帮助。Thanx作为回复,我在dealloc中释放了我的对象,但我注释掉了所有对象的释放,但仍然会崩溃您正在解除的viewController的dealloc方法中发生了什么?也许你在过度删除某些内容。如果你发布一些你设置的代码来显示/丢弃此viewController,这也会有所帮助。Thanx作为回复,我在dealloc中释放了我的对象,但我注释掉了所有的对象释放,但它仍然崩溃