问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/44618823/disclosure-indicator-not-triggering-accessory-action-segue