Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

ios - WatchKit reloadRootControllersWithNames causing error, with pageController or after push/pop

I have a basic watchkit app that loads a page based navigation of 3 interface controllers. This works well, but I'd then like to trigger an action to remove the page-control and essentially revert back to the original InterfaceController that was present when the app first loads.

// load page based control, with 3 views.  this works ok
[WKInterfaceController reloadRootControllersWithNames:@[@"pageController1",@"pageController2",@"pageController3"] 
                       contexts:@[@"data1",@"data2",@"data3"]];

// attempt to reload original interface controller, identified by storyboard id
[WKInterfaceController reloadRootControllersWithNames:@[@"myInterfaceController"] contexts:@[@{}]];

The page based navigation remove, the original navigation loads after a short spinner. However it fails to function correctly and original Actions result in this error.

Extension[6766:123665] *********** ERROR 
-[SPRemoteInterface _interfaceControllerClientIDForControllerID:] clientIdentifier for interfaceControllerID:(null) not found

Is there a better way to cleanly reload the original InterfaceController?

EDIT, 2/19

It seems there are some other actions that are causing this error too. For instance, if segue to a second InterfaceController and then popController to get back, the error often appears. It is always related to a secondary call to this function.

[WKInterfaceController reloadRootControllersWithNames: contexts:]

EDIT2, 3/18

As previously mentioned, this is reproducible 100% of the time by doing the seguePush, the popController, then attempting to reloadRootControllersWithNames.

If the seguePush/popController is not done beforehand, then the reloadRootControllersWithNames will work fine.

This situation seems to be in addition to the multi->single-multi instance of this bug.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is actually not a bug because according to Apple:

You cannot combine hierarchical and page-based interface styles. At design time, you must choose the style that best suits your app’s content and design for that style.

So unfortunately, we can't mix Hierarchical and Page-based navigation patterns within the same Watch app.

Just one of many limitations we have to deal with when developing apps for ? Watch


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...