I have my main view that has 3 UIButton that sends to 3 other views, I also have a slide menu (like the one used by facebook app) that has another 3 buttons that sends to the same 3 views of the buttons on the main view. I go to the views with a segue method, the problem is that using the buttons on the slide menu I create duplicates of the view (e.g if i press twice on the second button i'll create 2 identical views) is there a way to delete duplicated views that uses segue method?
if u know the names of the view u can always call
[myView removeFromSuperview]; method to remove your view that is u are creating dynamically so yeah u can remove it like this,
hope it helps
Related
In my application, I have one containerView which contains two sub-views. One sub-view contains list of buttons and the other contains a table view that based on the selection of button which in first view, the content of table view has to change.
My issue is while taping the button and content view table at same time app crashes. Please guide me to fix this issue.
In your case on button tap you are reloading table & simultaneosly selecting row from table. It's not consistent. If you want only action of one needs to be executed then set exclusive touch to all subviews of your containerView.
For all subviews do-
[subView setExclusiveTouch:YES];
I am working on app. It has normal 3 views. On third view, I have a table view. If I select any row, I want a view which contains UITabController. I have created a simple UITabController app, but unable to do this. How to do this ?
thanks in advance
IMHO, your question is perhaps ill conceived.
A tab bar controller controls view controllers which in turn control views. Your suggestion that a view contains a controller of controller simply does not make sense.
Maybe what you really want on selecting a row in your table view is to present a new view controller and then make the (existing) tab bar visible.
You usually want a UITabBar to be THE navigation for your application and not show it later on one view.
But if you want to do so you should show, as Mundi said, a new UITabBarViewController when you select your UITableViewCell.
I don't know your exact usecase, but if you work with a UITableView I would use a UINavigationController to push a new View when you tap one UITableViewCell. Then it may be better (If you have 2-3 Elements) to use a UISegmentedControl in the UINavigationBar. This would look like this.
I am writing an iPhone app that is supposed to create a TableView with 5 buttons. Each button is supposed to open up a different TableView.
I am using storyboards for my application, and the storyboard view controller shows only one button, so how can I link each button in my app to a separate detailviewcontroller?
Thanks!
If you want each button to trigger different controller than you have to create 5 seque with different destination controller and than when button is tapped , use following function to show different controller.
– performSegueWithIdentifier:sender:
Give each seque a different identifier and based on which button is tapped ( can be check using button tag) perform different seque and hence show different controller...
To pass data between viewController which is a common task, i am surprised you have not done it before :
goto this link .
I want to use the same TableView for 3 of my tabs instead of using 3 identical TableViews. I created three navigation controllers (one for each of the tabs) and linked them to the same Table View Controller But if I run the app with the storyboard like the picture below, it works for the first one of the sharing tabs, but for the other two I get a black screen where the tableView should be. So I want to know if it is even possible to make it work with this setup?
I'm trying this, so I don't have to make a litte change in the tableview 3 times.. The 3 tabs are populated with the same data too, just filtered differently, so just filter the array depending on which parent navigation controller would be simple I suppose.. But I need to know if this is a possible way of sharing view or not.
I would suggest a different approach. Just have three different table views. But since the question is not about being the right approach, I would say that the best way to do it is to do it by code, removing the tableview from the super view (The view controller's view) and moving it to a new view controller when the delegate from the tabbarcontroller is called. Keep in mind that you will also have to assign the delegate and datasource for each view controller.
I am creating a split view ipad app. I have four buttons in the master view which segue to four different views. However, when I am in certain views I don't need all of those buttons to display in the toolbar. So basically, is it possible to change the buttons for different views in a split view controller? any advice, tutorials, or source code would be sweet
Adding to what Lu Yuan said. You could put a pointer to the instance of the master view in your app delegate so that when one of your subviews load, it can get the master view instance. Then you can hide which ever master view buttons you want.