objective c - Re-use tableview from different controller: how to split didSelectRowAtIndexPath behaviour? -
I am currently working on my favorite implementation, in the end, it is working on the iPhone similar to the preferred features in the phone book needed.
I have the following set-ups (except for other controllers and classes):
- Tabber controller (designated main tab controller)
- Navigation controller < From the
FavoritesNavController , I want to select a line ( listNavController ) so that I can see in my favorite table view I could add a new entry.
Therefore, I decided to use my inventory NavController because all its functionality is essential to me like search, index, etc.
I have been able to show the listNavControler to mainTabBarController . So there is no problem here when I get a line from listNavController If I select, it displays my detailViewController for that line, of course, it was expected Because didSelectRowAtIndexPath in listNavController
But, when I listNavController from my current model view controller Favorite Nawab Controller , it still shows detailViewController while selecting a row.
In this case, I want to return the selected row to my FavoritesNavController then I can add it to my favorites list.
So, how do I differentiate this behavior in the code?
router
Div class = "post-text" itemprop = "text">
It turned out that I was looking in the wrong direction.
The solution to the posted question is as follows:
I have created a subclass of my list overridden the NVController and didSelectRowAtIndexPath method. After this I present this new visual controller with a navigation controller as a model view (current model week controller).
In the end, I start a protocol for class controller who performs representative and process in class. In this way, I can present and reject the subclass view controller from the same controller. A more clean and MVC way to go!
Comments
Post a Comment