1

Problem: The cancel controller will not be show after the test button is tapped if both "relationship segue" and "action segue" (push) are connected

enter image description here

Weird behavior: The cancel controller will show after the test button is tapped only if "action segue" (push) is connected. But not the "relationship segue".

enter image description here

Question: Why is it so?

user1872384
  • 6,886
  • 11
  • 61
  • 103

1 Answers1

2

You didn't describe that much but please note that hierarchical and page-based navigation are mutually exclusive so you can't use both.

"For WatchKit apps with more than one screen of content, you must choose a technique for navigating between those screens. WatchKit apps support two navigation styles, which are mutually exclusive."

https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/InterfaceStyles.html

jastrada
  • 384
  • 1
  • 8
  • This limitation doesn't make sense... I would like to have a page base navigation and also a hierarchical one... And for the hierarchical one, I need to pop back to root view controller from the 3rd/4th view.. For now I can use a modal segue together with a page base navigation. But how can I pop back to root view controller with modal segue? – user1872384 Feb 24 '15 at 05:20
  • It does make sense because you are only supposed to use one of those approaches and you can also use modal pages. Once you open a modal screen, there is a cancel button (on the title of the screen) to close it and go back. You can open a page based structure from a main screen and the closing those page based screens from any of them and go back to the main screen. – jastrada Feb 24 '15 at 13:30
  • Thx jastrada, you mentioned that "Once you open a modal screen, there is a cancel button (on the title of the screen) to close it and go back.". What if I have opened 2 modal view and want to go back to the root? Do I need to press "cancel" twice? – user1872384 Feb 25 '15 at 01:35
  • Didn't try that but I think you will need to press cancel twice – jastrada Feb 25 '15 at 12:21
  • Aiks... It's not very elegant to do that... Will post another question soon. – user1872384 Feb 26 '15 at 08:20
  • You are right, it is not. In my current project I have to do something similar to that (open 2 modals and go back to root). Please let me know when you post the question so I get noticed. – jastrada Feb 26 '15 at 12:21
  • it's here: http://stackoverflow.com/questions/28739473/how-to-pop-back-to-root-view-from-a-2nd-view?noredirect=1#comment45763835_28739473 Thanks! – user1872384 Feb 26 '15 at 13:18