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

发布于 2025-01-08 05:30:05 字数 1068 浏览 0 评论 0原文

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

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

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

Infect 我正在使用带有设备的打印机,我认为存在一些问题

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

Hi My iPhone application is crashing when i tap on back button. I really don't know why this is happening. you can see in picture where my application is crashing.Image of Xcode

I have already checked that my button is connected only with one action. So I am failed to know exactly what is the problem.

If my question silly then plz forgive me, I am new to iPhone development So please help

Infect i am using printers with device and i think there is some problem

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寂寞笑我太脆弱 2025-01-15 05:30:05

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

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

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

It might be that your previous view controller is lost so first check, is the controller that you wish to pop to still in the view controller stack?

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

If you can't see the view controller you want to pop to in that stack, it's likely that you either need to retain the controller. It might also be possible that you have released it too much, for example in the dealloc method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文