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

标签 iphone crash

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

我已经检查过我的按钮仅与一个操作连接。所以我无法确切知道问题是什么。

如果我的问题很愚蠢,请原谅我,我是 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

最佳答案

可能是您以前的 View Controller 丢失了,因此首先检查您希望弹出的 Controller 是否仍在 View Controller 堆栈中?

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

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

关于iphone - 转到上一个 ViewController 时应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9396423/

相关文章:

ios - UIButton 不会隐藏/取消隐藏

Java:Eclipse 崩溃(Linux)

ios - 应用被拒绝-启动时崩溃(iOS)

Python.exe appcrash 与 Ghost.py

c++ - 如何从崩溃中提取调试信息

iphone - 使用 OpenGLES 抗锯齿去除绳索的锯齿状边缘

iphone - 将 AVPlayer 快退 5 秒

android - 应用程序开发

iphone - 停用 UIScrollView 减速

python - python-2.7 timeit函数崩溃