I am new to iPhone programming and trying to grasp the concept of RootViewController.
Scenario:
I have 3 views
- RootViewController – Parent View
- SportsViewController – Sub View 1
- CricketViewController – Sub View 2
Both the subview have to be in FullScreenMode, so tab-bar or navigation bar cannot be used.
At first, Sub View 1 is loaded which is having some content and a DONE button on it.
Once user press DONE button then Sub View 1 has to be unloaded and RootViewController should load the Sub View 2.
Query
I have successfully displayed SubView 1 and when user taps on DONE then I can unload it. But I did n’t get how should I notify the RootViewController from Sub View 1 that Sub View 1 has unloaded and now it should load the Sub View 2?
Thanks in Advance
Paras Mendiratta
Here is my code where I tried to use delegate pattern.
The problem is the sub view 1 (videoPlayer) is not able to call the delegate methods. 🙁
ViewSwitcher.h – Root Controller
ViewSwitcher.m – Implementation
VideoPlayer.h – SubView 1 (Movie Player)
VideoPlayer.m – implementation
Here is the LOG:-