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

Stratoukos

macrumors member
Original poster
Jul 15, 2008
51
0
First of all let me clarify that I am not asking why to use a controller. I am just asking why to subclass UIViewController instead of just making my own controller (subclassing NSObject). I've read through the documentation and I haven't seen anything I need to inherit from it. My view won't load from a nib and it won't need to handle rotation. I am just asking since it's kinda de facto to use it.

So, can I safely make my own controller or is there something I'm missing?

Thanks.
 
First of all let me clarify that I am not asking why to use a controller. I am just asking why to subclass UIViewController instead of just making my own controller (subclassing UIObject). I've read through the documentation and I haven't seen anything I need to inherit from it. My view won't load from a nib and it won't need to handle rotation. I am just asking since it's kinda de facto to use it.

So, can I safely make my own controller or is there something I'm missing?

Thanks.
Is your viewController going to load a view or have to deal with it appearing and disappearing? Is it going to need to respond to events? Cuz those things are also handled by the viewController.

P.S. There is no UIObject. You probably meant NSObject, right?
 
Yep. There it is. I knew it was there for a good reason. Thanks for the really quick reply.
You're welcome. When trying to determine if subclassing is for you, sometimes it helps to step through the hierarchy of the ancestors to see what you are getting as well. UIViewController < UIResponder < NSObject.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.