gpt4 book ai didi

swift - 没有这样的模块错误 "NotificationCenter"WatchOS,Swift

转载 作者:行者123 更新时间:2023-11-30 11:05:31 26 4
gpt4 key购买 nike

我在尝试导入NotificationCenter框架的两个 Controller 中遇到模块错误。我已在“链接的框架和库”中添加了框架,但仍然收到错误。

我什至尝试了cmd + shift + k,但它对我没有任何好处。

我也尝试将框架搜索路径设置为 $(SRCROOT),但仍然出现相同的错误。

我有两个带有导入的 Controller 。

Linked frameworks and libraries

Added notificationCenter

时间 Controller

import WatchKit
import Foundation
import NotificationCenter error: "No such module 'NotificationCenter'"

滑动 Controller

import WatchKit
import Foundation
import NotificationCenter error: "No such module 'NotificationCenter'"

任何帮助将不胜感激!

最佳答案

我同意@David 的评论,单个 watchOS 项目有三个目标。

您需要为每个目标尝试以下步骤:选择每个目标并转到 -> 构建阶段

Screen1

点击右箭头。然后点击+ Step2

最后,搜索NotificationCenter并添加框架。

您需要为每个目标尝试这些步骤。

Watch

关于swift - 没有这样的模块错误 "NotificationCenter"WatchOS,Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52781938/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com