简体   繁体   English

Apple Watch Simulator使用通知视图启动Watch App。 如何自动启动主程序?

[英]Apple watch simulator starts watch app with notification view. How to auto start in main?

I didn't have have this problem before! 我以前没有这个问题! I don't know what I've done. 我不知道我做了什么。 Created an apple watch extension to my project, and connected a few labels to the main storyboard (the main interface controller) and didn't touch the storyboard stuff for the notification and glance scenes (I've checked to add those when adding the extension) 为我的项目创建了一个Apple Watch扩展程序,并将几个标签连接到了主故事板(主界面控制器),并且没有触及用于通知和扫视场景的故事板内容(在添加扩展程序时,我已经检查过添加这些标签)

At first, when running the simulator it would enter to the main scene. 首先,当运行模拟器时,它将进入主场景。 But now there's a blank notification thing that comes up with "dismiss" and another button above it. 但是,现在有一个空白的通知内容,上面带有“ dismiss”和另一个按钮。 Hitting that button allows the regular scene to load. 按下该按钮可以加载常规场景。

Anyone know what's up? 有人知道怎么回事吗?

You have to select your watch app as the build target, I guess you've selected your notification scene target right now. 您必须选择手表应用程序作为构建目标,我想您已经选择了通知场景目标。

Just select it in the top left corner of Xcode: 只需在Xcode的左上角选择它即可:

目标选择教程

Could it be that the initial interface has been set to the notification? 可能是初始界面已设置为通知吗? Here's how to check: 检查方法如下:

  1. Pull down the Project menu, select Scheme, then make sure your WatchKit app is selected. 下拉“项目”菜单,选择“方案”,然后确保选择了WatchKit应用。
  2. Under the Project menu (again), select Scheme, then Edit Scheme. 在“项目”菜单下(再次),选择“方案”,然后选择“编辑方案”。
  3. Select Run in the left panel, then verify that "Watch Interface" is set to "Main" (and not something like "Static Notification") 在左侧面板中选择“运行”,然后确认“监视界面”设置为“主”(而不是“静态通知”之类的东西)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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