Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大哥你好, 我是小白,问个关于使用WMPageController传值的问题 #10

Closed
WQNMLGM opened this issue Aug 5, 2015 · 8 comments

Comments

@WQNMLGM
Copy link

WQNMLGM commented Aug 5, 2015

正在使用你的 WMPageController, 但是我发现它的init方法用的是添加class的方法, 现在我想实现从当前控制器向WMPageController管理的其中一个控制器传值, 想了好久都没有解决方法, 故此请教,望回复

@wangmchn
Copy link
Owner

wangmchn commented Aug 5, 2015

请问下当前控制器是指创建WMPageController的控制器吗?还有传值的目的是什么呢?

@WQNMLGM
Copy link
Author

WQNMLGM commented Aug 5, 2015

就像WMPageController Demo 中的在前一个tableview中创建了WMPageController管理3个视图控制器, 向其中的一个控制器传一个ID, 做网络请求

@WQNMLGM
Copy link
Author

WQNMLGM commented Aug 5, 2015

但是因为WMPageController的 initWithViewControllerClasses 方法用的是Class, 不能用属性传值, 我是一个小白,不知怎么解决了

@wangmchn
Copy link
Owner

wangmchn commented Aug 5, 2015

是每个控制器对应一个ID吗?然后这些是在之前的控制器通过网络获取的?
好像没有什么好的方法,用单例或者做一下本地缓存吧= =

在 2015年8月5日,17:59,WQNMLGM notifications@github.com 写道:

就像WMPageController Demo 中的在前一个tableview中创建了WMPageController管理3个视图控制器, 向其中的一个控制器传一个ID, 做网络请求


Reply to this email directly or view it on GitHub.

@WQNMLGM
Copy link
Author

WQNMLGM commented Aug 5, 2015

是的, 想了很长时间好像除了单例也没别的方法了, 其实如果能在创建控制器的时候实例化控制器, 而不是直接接受控制器的Class,可能会更好用,比如在页面之间传用属性传数据等, 但我是小白,不知怎么修改

@wangmchn
Copy link
Owner

wangmchn commented Aug 5, 2015

不太好改 因为整个都是通过class来的,要改的话会牵扯到挺多代码。。之所以用class是为了考虑多控制器的内存情况,合理的释放和创建

@WQNMLGM
Copy link
Author

WQNMLGM commented Aug 5, 2015

(⊙o⊙) 不明觉厉, 其实也不必要改, 自己尝试用单例解决把,感谢大神的分享

@wangmchn
Copy link
Owner

wangmchn commented Aug 5, 2015

有问题继续交流 :)

@wangmchn wangmchn closed this as completed Aug 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants