How to open UIViewcontroller from a UISplitViewController (left side tableview)? - ios

I have one UISplitView Controller and on left side i can see UISplitView tableview part and right hand side i can UIViewController view.
I added one UIBarButton to UITableViewController (navigationbar) and when i clicked on UIBarButton (on left side UITableView) it showing following error message in console.
"
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "3rQ-6t-ad4-view-1Zq-6N-cLc" nib but didn't get a UITableView.'
"
How to load a new UIViewController from UISplitView in iOS ?
Pls help me

Can you make your question more clear?
As far as I can understand your UITableViewController's view was nil when it tried to access it. Hence it called loadView function to make the view. Can you check whether you have connected all the outlets correctly . This is the commonest mistakes that the newbies in iOS make.Comment when you have checked that.

Related

iOS TabBarController with custom MoreNavigationController

I am trying to create a custom UITabBarController that instead of showing a "more" view controller, I want my tabs to be scrollable. I've already created a custom UITabBar with a collectionView with my tabs and it works great.
However when I add more than 5 tabs, the more navigation controller comes into play. I need that to be my custom Navigation Controller that allows the NavigationBar and the TabBar to hide themselves as the user scrolls, however, since the default MoreNavigationController is a normal UINavigationController, the desired behaviour does not occur. I've tried embedding my ViewController in my custom NavigationController before adding it to the TabBarController, but (as expected) since the MoreNavigationController is already managing all the ViewControllers after the 5th, it has no effect.
I've tried overriding UITabBarController's var moreNavigationController: UINavigationController and return my custom NavigationController. However, when I run my app it crashes with the following message:
-[MyApp.ScrollingNavController setMoreViewControllers:]: unrecognized selector sent to instance 0x7ffbce831000
2018-05-23 13:45:27.573611+0300 MyApp[6000:190109] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MyApp.ScrollingNavController setMoreViewControllers:]: unrecognized selector sent to instance 0x7ffbce831000'
I do not know how to overcome this problem, so if anyone has any ideas, please let me know. Thank you!

segue button to next viewcontroller throws error in xcode

I have a tabbar ios application. I put (embed) NavigationController in one of the viewcontroller,then added one button and one new viewcontroller to pass. I dragged from button in first vc to new vc and select "push".
But following error message is thrown when I tab the button :
Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
I really don't understand because I have already a navigation controller and also not added any additional code yet.
Thanks for any help.
You may not use push segue with a button that you have created yourself. Try using Modal segue instead.

Connecting navigation controller through button on Storyboard crashes app

I am using a Storyboard for the first time.
Here is a picture:
My app is a TabBar application. From the 'Main' screen I have a settings button, which I would like to connect to the SettingsViewController, which I have embedded in a Navigation Controller (because it has to continue in that manner - to other parts of the settings screen).
Another picture:
NOW: I have tried connecting the settings button (command+control drag) to the controller (modal segue)= CRASH. Tried to connect the settings controller (modal segue) = CRASH.
Tried programmatically : creating an IBAction for the settings button an then calling the settings VC, but that crashes too.
Note: This app has many many more screens, but they all work fine. It's just the connection to the Settings VC that Is crashing the app.
Any ideas would be appreciated.
Here is the error log:
So you get the error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
'-[UITableViewController loadView] loaded the "Eab-23-IvL-view-eGY-e2-X6m" nib but didn't
get a UITableView.'
Which means that your Settings View Controller, which inherits from UITableViewController, does not have an actual UITableView in the storyboard. A fix that will definitely work is to just remove the settings view controller from the storyboard and then drag a Table View Controller in place of the one you removed. Then just proceed to give it the right class in the identity inspector and set back up all of the segues and connections!
You're using UIToolBar when there is a proper way to handle it, with UINavigationBar.
Then you can set a button, connect the button to settingViewController (control+drag), then choose modal, set a name to the segue, also control+drag the bar button item to your viewController and connect like this:
- (IBAction)btnSettings:(id)sender {
[self performSegueWithIdentifier:#"settingsSegue" sender:sender];
}
Then it should work.

iOS: Problems with a button which is on a UIView located in a UINavigationView which is in a UITabView

I have a following application structure:
Tabs - Tab1 - 5. On on of the Tabs I have a navigation view and instead of having a tableview like in following tutorial:
http://broadcast.oreilly.com/2009/06/tab-bars-and-navigation-bars-t.html
I would like to have buttons on a page instead of a table view just like in this tutorial:
http://fuelyourcoding.com/iphone-view-switching-tutorial/
I built the application and all the views but when I click on the button to move to the next view it crashes and I get following error message in the debugger console.
...Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView copyWithZone:]: unrecognized selector sent to instance 0x5d207b0'
... Call stack at first throw:
When just having a UINav. with buttons it works fine and the UITab works fine but together it crashes as soon as you click the button on the page. I even used a IBAction which just wrote a message into the log (NSLog) so I just cannot seem to figure out where the main issue is?
Well, it's an old question and I suppose it is already solved, but I encountered that same problem today... And I hope it may be useful to somebody.
This is just a mistake with an association of a Connection in the Interface Builder, you may have changed an outlet's name programmatically and the connection is still associated with the old name in the Interface Builder.
Solution: Go to IB and update the Connections of the affected View Controller.

Application Terminates due to Popover

I am working on IPad application. As per requirement On detail page of SplitviewController I am adding one customized UIBarButtonItem leftbar button on navigation bar.
Now in Portrait mode when I click this button I am getting following error
Terminating app due to uncaught
exception
'NSInvalidArgumentException', reason:
'Popovers cannot be presented from a
UIBarButtonItem that is not in a
toolbar or navigation bar already.'
Can one please help on this ????
Thanks,
Sagar
You most likely didn't declare your UIButtonItem variable correctly. Make sure it matches everywhere throughout your code.
For more info check out my blog post.

Resources