开发者

How can I assign properties correctly?

开发者 https://www.devze.com 2023-01-03 19:10 出处:网络
I have a UITabBarController that I would like to assign to another object, 开发者_StackOverflowso that that object can control it:

I have a UITabBarController that I would like to assign to another object, 开发者_StackOverflowso 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?


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号