Receiver类型的实例消息是一个向前声明popToRootViewController [英] Receiver type for instance message is a forward declaration popToRootViewController

查看:87
本文介绍了Receiver类型的实例消息是一个向前声明popToRootViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾在这个错误中看到类似的问题。
但我不知道在这种情况下如何应用

I've seen similar questions on this error. But I'm not sure how it applies in this instance

这是错误

Receiver type for instance message is a forward declaration

我的代码。

MyAppDelegate *appDel = (MyAppDelegate*) 
    [[UIApplication sharedApplication] delegate];
[appDel.secondTabNavController popToRootViewControllerAnimated:NO];

这里有什么问题,如何解决?

What's the problem here and how do I fix it ?

我澄清了我对这个代码的使用是正确的,作为我的标签控制器中的每个标签的不同的导航控制器。我这样做,因为我推在每个控制器内的视图。
几个UINavigation控制器,每个选项卡一个,作为我的应用程序委托的插座?

I clarified my usage of this code was correct, as a different navigation controller for each of my tabs in my tab controller. I do this as I push views within each controller. Several UINavigation controllers, one for each tab, as an outlets from my app delegate?

推荐答案

尝试导入appdelegate.h和它应该工作正常。

Try to import the appdelegate.h and it should work fine.

更好的实现方法是使用通知。
1.达到条件时发送通知
2.在相应的视图控制器中处理通知。 (你可以在应用程序委托处理它,但它不是一个干净的方式)

A better way of implementing this would be to use notifications. 1. Send a notification when you reach the condition 2. Handle the notification in the appropriate view controller. (You can handle it in the app delegate too but it is not a clean way)

这篇关于Receiver类型的实例消息是一个向前声明popToRootViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆