An accessory, Detail Disclosure, was configured for a cell in a TableViewController that segued into another TableViewController which worked fine.
Then it was changed on the Storyboard to Disclosure Indicator and it no longer works. There are no errors or anything to indicate why this happened. How can it be fixed?
It is not supposed to work:
DisclosureIndicator
The cell has an accessory control shaped like a
chevron. This control indicates that tapping the cell triggers a push
action. The control does not track touches.
From documentation:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics.html
Related
I'm trying to segue from a tableview to a viewcontroller embedded in a navigation controller using a show accessory action segue and the disclosure indicator (Shown in picture). Clicking anything including the disclosure icon does nothing. If I change the segue from "accessory action" to "selection," the segue works, but thats through clicking anywhere in the tableview cell as intended. My goal is to use "accessory action" to segue only when the disclosure indicator is pressed.
I know there are programmatic ways of doing this but those aren't working either. I'm assuming the underlying issue preventing this operation through a navigation controller is also preventing the programmatic methods from working. How do I get the disclosure indicator to segue to another view controller?
accessorybuttontappedforrowwith only works when the accessory type is equal to "detail disclosure" AND accessory view is nil. Therefore it will never work with "disclosure indicator."
Days of research tell me that the community consensus is that there is no explanation as to why this is other than thats what apple engineers decided and that the "disclosure indicator" is simply symbolic as opposed to a button from which methods can be invoked. Most agree that it doesn't make any sense given the existence of the above method.
My question is very similar to this:
Disclosure Indicator doesn't call seque while Detail Disclosure does
But is a bit different.
The same is happening to me. I have a dynamic table view which loads some rows at viewLoad.
So I set the segue from the Cell to a new View which will show some details of the item. I also set the Segue to Push.
When I do that, the Cell automatically sets its Accessory to Detail Indicator (So the blue info button appears) This works fine, I click on the info button and it loads the new view. But I do not want that, I want the Cell to have a Disclousure indicator (the arrow) and whenever you click on the entire row, just Push the new view. I did this on an Static Table View and it worked fine, but I can't make it work with a Dynamic Table. Nothing happens when I click, just the animation of the tap and nothing else.
No, it's not ok to change an accessory action segue to a selection one by setting the accessory to none -- that doesn't change the segue type. The fact that you got the blue button when you made the segue means you chose an "Accessory Action" segue. When you drag from the cell to the next controller and let go, you get a menu of choices that's divided into two sections. The top ones are Selection segues, and the bottom set are Accessory Action segues. You need to delete your segue and remake it, being sure to choose from the Selection segue choices.
I have an interesting problem. I'd like to have detail screen pop up when people click on the arrow in the Table View. The cells are dynamic.
When I select Disclosure Indicator - I do not get the segue called and and I don't get accessoryButtonTappedForRowWithIndexPath called either. When I change it to Detail Disclosure everything works just fine.
Any guesses to what I can do to make the disclosure indicator act just like the detail disclosure?
Thanks!
Disclosure indicators are not buttons and therefore do not cause the tableView:accessoryButtonTappedForRowWithIndexPath: delegate method to fire, while a detail disclosure is a button and therefore does fire that method.
The best you can hope to do, I imagine, is to add a UIButton to your table view cell and give it an image that very closely resembles the default table view disclosure indicator. This is kind of a hacky solution though, so I would discourage you from actually doing this.
Lately, when I try to add a seque to my UITableView cell using the storyboard:
Xcode is auto-adding an info icon / "Accessory Button" to the cell:
I know I can remove it like so:
However, there appear to be other issues that might also be symptoms of whatever is causing this behavior, but that's a separate question... My question here is why is Xcode adding it in the first place? It's never done this before when I've added storyboard seques...
During creation of the segue you have selected "Accessory Action" in the segue action popover. If you do this Xcode will set the accessory to "Detail Disclosure", because you need a tappable accessory to have an accessory action.
Select a Segue in the upper part of the popover. Those are Selection Segues, which are triggered when you select the cell.
This does explain your other issue as well. Because your segue is connected to the accessory, which you remove. So there is no way to actually trigger your segue.
Select the cell and go to the attributes inspector
Scroll down to Accessory
In the drop down menu you will be having etail Disclosure selected
Change it to Disclosure Indicator
There are two different behaviors for the segues.
You can see them on your inspector: triggered segues.
If you choose the accessory action, Xcode automatically add an accessory button (the circle).
If you choose the selection action, you have no accessory button.
I've got a weird issue with segues - I have a segue open a popover when a UIButton is tapped, all of this done through IB. (This is on iPad)
But when I select an option from the Tableview on this popover I want it to dismiss the popover. And I don't want the popover to open twice if the user taps that UIButton twice..
The way things work by default, tapping that UIButton keeps opening popovers on top of each other "forever" and also I still have the issue that when a cell from my Tableview is tapped, the popover remains.
How can I solve these problems?
Use prepareForSegue: method to dismiss the pop over if it is already present.
Here is given, how to use that method.
Prevent multiple popovers:
Use an if statement to determine whether a popover is present or not, if it isn't present it, if it is don't.
Dismiss on cell tap:
In didSelectRowAtIndexPath call dismissPopover on your popover view.