View Full Version : View - Controller - Model question
ryanknu
Nov 2, 2008, 12:50 AM
Hey, I'm not even sure if this is possible but I'm stumped by this one. I set up a program with a model to hold the data and do the calculations, a controller to connect outlets and call methods on the model, and a custom view to put it all together. But I'm having a problem figuring out how to call a controller method from within the custom view, because of the way IB instantiates it separately from my code. Is it possible to hold onto a pointer to the controller inside the view, or is there a better way to do this?
SydneyDev
Nov 2, 2008, 01:42 AM
You usually put the Controller in the NIB file and put an outlet to the view on it. To instantiate one of your own classes in a NIB, drag an NSObject from the Palette and then set the class to your class in the identity tab of the IB inspector.
ryanknu
Nov 2, 2008, 09:05 AM
My view is an outlet on my controller, but what I want is to do the same thing, only the other way around. I also want my view to have an outlet to the controller, so that it can tell the controller when to do stuff.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.