r/simpleios • u/zievereir • Jan 01 '12
[Question]Pushing a SplitViewController on a NavigationController is not allowed?
I am working on an iPad app that has to be used to add data and look up added data (and other functionalities but that's beyond the scope of my question). I use a NavigationController to navigate between the different views. A view located deeper in my application is supposed to allow my user to lookup data that was inserted in another view, presenting this data in a SplitViewController seemed to be a no-brainer to me.
Now as I implemented this I figured out that Apple seems to prohibit you from pushing a SplitViewController over a NavigationController, an Exception is thrown when you try to do that. Basically they say that the SplitViewController should be the main view of your application and therefor should be the view your application is build around. I am a bit boggled about why they would add a (IMO ridiculous) rule like that which seems to greatly limit the possibilities of your app?
As a workaround I can of course just build a SplitViewController-like view myself using a TableViewController and a popover for the user to select his records. Another way to get around that rule is to add a method to your ApplicationDelegate that makes the SplitViewController your RootViewController and calling that method when the SplitViewController is supposed to be shown. But ofcourse doing that will most likely prevent your app from being published to the app store... Then again my target isn't really the app store, but I rather not code it in a 'dirty' way unless it's just not possible.
Are there any cleaner ways to get around this? Some extra clarification to make me understand why they implemented this rule would also be deeply appreciated.
Thanks!
View all comments
Show parent comment
2
u/zievereir Jan 02 '12
That's nice to hear, thanks for your input!