I always use UIViewController(As RootViewController) to switch the view of 3 different UIViewControllers.
There are some commonly-used functions in the RootViewController.
I setup the protocol for the 3 different UIViewControllers to access.
The actual function body codes are in RootViewController.m
If I want to call these function, I just need to write codes below in anyone of 3 UIViewController to call the function ‘aFunction’ in RootViewController.m
[myDelegate aFunction];
Now, I hope to use UITabBarController(As RootController) to switch the view of 3 different UIViewControllers.
I still hope to keep the mode above that store the commonly-used functions in the place where all 3 UIViewControllers can access via protocol.
Where do these function codes need to be writen to?
I can not find out the source codes body for UITabBarController. (RootViewController has the codes body RootViewController.m)
Welcome any comment
Thanks
interdev
Create a subclass of
UITabBarControllerand put the methods in there.