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



Question:

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? Or can I tap into the code that loads the main application NIB?


Solution:1

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.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »