开发者

How do I set up a proxy object in the main application NIB?

开发者 https://www.devze.com 2022-12-17 21:21 出处:网络
I would like to set up a proxy object in the application NIB file. The problem is that the NIB file is the main application NIB that gets loaded automatically by the application and therefore I cannot

I would like to set up a proxy object in the application NIB file. The problem is that the NIB file is the main application NIB that gets loaded automatically by the application and therefore I cannot set up the UINibProxiedObjectsKey dictionary as described in the documentation. Is there a way to set up a proxy object in the main application NIB开发者_如何学C? Or can I tap into the code that loads the main application NIB?


My main problem was that I was trying to use Interface Builder as a dependency injection tool for the whole application. I had an instance of an object that had to be created in code and then I needed to pass this instance to other objects in the NIB, therefore the need for proxy objects. In the end I found the proxy object stuff to be overkill. I created a separate class that takes care of wiring my objects together and the problem disappeared.

0

精彩评论

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

关注公众号