0

I am developing a simple iPad application. I have an array of category objects, and each category object holds an array of item objects related to that category. I want to show the categories on the left of the screen (in a UITableView), and whenever a category object is selected, I want to display the corresponding item objects (from the array of that category object) on the right (in a UITableView).

I looked around for a good way to design it, and I find UISplitView offers what I need. However, I also observed that using UISplitView along with TabBarController could be painful. On the other hand, I couldn't find any disadvantage using 2 UITableViews. So, in my case, is there any good reason to use UISplitView instead of 2 UITableViews attached on each other? OR Is there any drawbacks to use 2 UITableViews instead of a UISplitView?

Note that I want to use the application only in landscape mode, so I don't need popup thing (see image) or something that allows me to hide/unhide when orientation is portrait.

portrait mode

mamba4ever
  • 2,662
  • 4
  • 28
  • 46

1 Answers1

0

I think it would be better if you use SplitViewController like the way its implemented in iPad Mail stock app. There is a button on the detailViewController that hides and unhides it when tapped and get rid of the PopOverViewController.

Check out the questions on StackOverflow here and here. Also watch this video tutorial on Vimeo here that show how to implement it.

Community
  • 1
  • 1
AJ112
  • 5,291
  • 7
  • 45
  • 60
  • Thanks for the answer, but what I need is 2 side by side tableviews. As I said in the question, I don't want popup thing that is used for hide/unhide – mamba4ever May 19 '13 at 13:32
  • There won't be any popup thing, just a button to hide and unhide it. Are you saying you don't want a simple button as well? – AJ112 May 19 '13 at 13:41
  • Yes exactly. Because without left or right tableview, screen seems quite empty. Also seeing categories (left) and items (right) all the time makes more sense in my case. – mamba4ever May 19 '13 at 13:45
  • You can use SplitView delegate methods so the masterview always remain on the screen and tapping one of the entries in it will show the detail on the right hand side. Is this what you want? – AJ112 May 19 '13 at 13:52
  • It's what I want, and I know I can use SplitView, but as I said in my question, is there any good reason to use UISplitView instead of 2 UITableView. OR let me say in this way, is there any drawbacks to use 2 UITableViews instead of a UISplitView – mamba4ever May 19 '13 at 13:57
  • If you don't need orientation changes or show/hide/popover logic, there's not much the split view controller can give you. Apart from those, its main value would be the separation of interface logic into individual sub-controllers rather than a single class. – Phillip Mills May 19 '13 at 14:38
  • I don't think there are any drawbacks to using boths ways you have mentioned as long as the code is optimized. SplitViewController is a choice. In one of my test project, i have implemented the SplitView effect without using SplitViewController. Instead i used two container views to implement it. So its just a matter of choice. Its programming, there are always multiple ways to do the same thing. – AJ112 May 19 '13 at 17:23