如何正确分配属性?
我有一个 UITabBarController,我想将其分配给另一个对象,以便该对象可以控制它:
watchListView.tabBarController = self.stTabBarController;
在此分配期间, self.stTabBarController
和 watchListView.tabBarController
的值是 0x0。
如何分配 UITabBarController 的?
I have a UITabBarController that I would like to assign to another object, so that that object can control it:
watchListView.tabBarController = self.stTabBarController;
During this assignment the value of both self.stTabBarController
and watchListView.tabBarController
are 0x0.
How can I assign the UITabBarController's?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该分配(至少在语法上)是正确的。问题是您在源属性本身尚未设置的情况下执行此操作。
如果不了解这种情况发生的时间和地点,就很难猜测问题是什么。您打算在什么时候拨打此电话?控制器曾经存在吗?随后是否有某个时间该属性明显非
nil
?The assignment is (at least syntactically) correct. The problem is that you're doing at a time when the source property has itself not been set.
Without knowing more about when and where this is happening it's difficult to guess what the problem is. At what point are you trying to make this call? Does the controller ever exist? Is there some subsequent time where the property is demonstrably non-
nil
?