I have 6 views.The second controller is Splitviewcontroller and third controller is viewcontroller.Now How can i navigate from uiviewcontroller which is 3rd view to another splitviewcontroller.
Your ViewController is most likely presented in a modal, in which case it should have a delegate to your SplitViewController.
When you're done with the ViewController, you can call the protocol method on the delegate, which then dismisses the modal with a call to dismissModalViewControllerAnimated and voilĂ , you're back in the SplitViewController.
If you're not familiar with the Protocol/Delegate stuff, here's a good post about it.
Related
I can use navigation without segues (1) but I would like to use it (2).
Performing a segue and navigating back make my app slower ! Because it doesn't dispose destination view when I navigate back. How do you use this segues in a right way ?
/*1) This code ok! But what about segues */
if(_tabbarController==null)
_tabbarController = (UITabBarController)this.Storyboard
.InstantiateViewController ("MainTabbarController");
this.NavigationController.PushViewController (_tabbarController,true);
/*2) If I run this code I get a new instance of UITabbar */
this.PerformSegue("SegueShowDetail",this);
If you're using the Storyboard and a Navigation Controller, the navigation controller should automatically release your view and associated memory with it when it pops off the stack.
For example, if you've got a method that gets called when you push a button to go to another view, you'd have:
[self performSegueWithIdentifier:#"mySegueName" sender:self];
When you click the back button at the top left of your secondary view, this will trigger the navigation controller to dispose of the view.
I have 2 viewcontroller and in that one controller having a button, now i want when i pressed the button it will show the next viewcontroller without using navigation and modalviewcontrollers...
How can i do this plz help me....
If you want to present a controller's view without using navigation or modal view controller, you can simply add the controller's view as a subview of the window.
In the controller that will present the next controller you would do the following:
[self.view.window addSubview:controller.view];
EDIT: Try the following:
[((YourAppDelegate *)[UIApplication sharedApplication].delegate).window addSubview:controller.view]
This assumes that your app delegate has a window property.
EDIT 2: Here's another option.
[[UIApplication sharedApplication].keyWindow addSubview:controller.view];
in the main view controller i have a scrollview and paging control.
i have added another viewcontroller's view as a page of paging control in scrollview.
now i have 9 buttons on that view controller's view which is inside scroll view.
now when i click on the buton i wants that main view controller's view should be pushed to another view controller.
but not getting how it can be done as the buttons are in view which is in the scrollview.
When a user interface element created in interface builder seems not to be doing what you told it to do, you should verify that:
you saved your changes to the nib in IB
that you correctly declared your ivars/properties as IBOutlet and connected your outlets in IB
that there are no views hijacking your events.
If the buttons in your view inside the scroll view don't appear to be getting press events, you may need to adjust the userInteractionEnabled property of parent views.
You can "move" any view from one view hierarchy to another by doing:
[myView removeFromSuperview];
[anotherParentView addSubview:myView];
How do I refresh a tableview after returning from Background(when the user hit home button and comes back later). Its not calling the viewWillApper delegate method.
Thanks,
Shinto.
Override applicationDidBecomeActive or applicationWillEnterForeground in the appDelegate. Then I would either call the table view controller to reload or use a NSNotification.
Note: applicationDidBecomeActive is also called when the app launches. See: Understanding iOS 4 Backgrounding and Delegate Messaging
u can do it in the Home Button. First Get the ViewController thats hold the TableView and do further action...
In my windows based applicaton, after login screen and registration page I added navigation controller for next two views. After pressing button present on second navigation window,again i want normal view controller and not navigation. But Its giving me navigation window with back button which takes me to second navigation window.
Can anyone plz tell me the solution??
You have a couple choices: you can truly eliminate the Navigation Controller entirely and replace it with another UIViewController (more complicated), or you can just push a new UIViewController that will not have a navigation bar/back button, and use that as the effective "root" view controller of your application from there on out. Without the navigation bar, your view controller will look like a "normal" view controller.
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBar.hidden = YES;
...
}