简体   繁体   中英

Apple Watch Storyboard: Unsupported Configuration - Interface Controller is unreachable for a modal controller

I am developing UI for my watch app. I have a Home Interface Controller, and when a push notification arrives, a second Modal Interface Controller should show up.

I dragged the two interface controllers onto the storyboard. Usually, if there is a button/table cell etc on a controller, a modal segue can be created by dragging from the button to the modal controller. Since my modal controller is not presented by interacting with a button, but rather by responding to a push notification, I decided to present the modal controller programatically. (I can't seem to find a way to create a modal segue without a button in storyboard. Directly dragging from one controller to the other only presented me with the option of a next page segue, but no modal segue.)

However, if I do it in code, a warning will be shown in the storyboard saying my modal controller is unreachable. From the storyboard the modal controller does seem standalone and detached, but I am presenting it in code. Is there a way to make the warning go away?

For fixing that, you need to provide an Identifier for that particular View Controller. Go to the Attribute Inspector , In the Identifier field add a value. This value is used for accessing the View Controller via code, so it should be unique.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM