Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ryanknu

macrumors newbie
Original poster
Sep 12, 2008
12
0
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

macrumors 6502
Sep 15, 2008
346
0
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

macrumors newbie
Original poster
Sep 12, 2008
12
0
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.