iOS - 将值从对象传递到它的包含类
设置:
我有一个appdelegate,并在其中声明是custunUiviewController.h,在该控制器中,我有RandomName.h声明(作为对象,而不是子类)我可以使用[super Methotname]或类似从anduralName.h上触发customUiviewController上的方法。H?
还是我必须将其传递给AppDelegate,然后从那里转到CustomUiviewController? (我一直在做)
感谢
P.S.咖啡很好。
The setup:
I have an AppDelegate and declared on that is CustomUIViewController.h and in that controller I have RandomName.h declared (as an object, not a subclass) can I use [super methodName] or similar to trigger a method on CustomUIViewController from a method on RandomName.h?
Or do I have to pass it to the appDelegate and then from there to CustomUIViewController? (How I have been doing it)
Thanks
P.S. Coffee is good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为我已经理解了您的问题。如果我没有; - )
super
赦免我。您可以简单地调用,另一种方法是将 customViewController 的引用传递给 andarmname 对象,类似的东西,
您必须保留 self 在 initwithparent 方法中,可以说变量名是 parent ,然后调用这样的方法,
I think I've understood your question. Pardon me if I didn't ;-)
super
doesn't work that way. You can simply call,The other way is to pass the reference of the customViewController to RandomName object, something like,
You have to keep the reference of self in initWithParent method, lets say the variable name is parent, and call the method like this,