迅速迁移:'通知'在此上下文中,对于类型的查找而言,这是模棱两可的'在某些地方
我正在从Swift 2.3迁移到Swift 5,这很痛苦,好吧,我正在结束迁移,但我仍在代码的某些地方遇到错误:
Notification'在此上下文中查找
我在此错误之前收到了收到的收到,但是现在我在这样的地方收到了此信息
var notifications = [Notification]
self.notifications = (sql.execute() as NSArray) as! [Notification]
,
func isAlreadyExists(notification: Notification) -> Bool {
我想更改通知名称,但是该应用程序不是我的,而且很大...非常大,无法做到这,好吧,我不知道该怎么办。
提前致谢。
编辑: 尝试做与我如何消除具有相同名称的类型和模块?,但要做“ import(class | struct | func | stolops | enum)module.symbol” des不起作用(我知道通知在哪里该项目但不起作用projectName.class)。
I'm making a migration from Swift 2.3 to Swift 5 with a lot of pain and well, I'm ending the migration but I'm still getting an error in some places of the code:
Notification' is ambiguous for type lookup in this context
I recieved before this error but now I'm getting this in places like
var notifications = [Notification]
self.notifications = (sql.execute() as NSArray) as! [Notification]
and
func isAlreadyExists(notification: Notification) -> Bool {
I thought to change Notification name but the app is not mine and is big... very big and is not possible to do this and well, I don't know what to do.
Thanks in advance.
Edit:
Tried to do the same as suggested in How can I disambiguate a type and a module with the same name? but doing "import (class|struct|func|protocol|enum) Module.Symbol" desn't works (I see where Notification is in the project but doesn't work ProjectName.class).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最后,它通过更改类名并将其添加到名为
< project_name> -bridging-Header
的文件中来起作用。这样做我可以用
var example =< project_name>。className>
来调用课程。Finally, it worked by changing the class name and adding it to a file called
<Project_name>-Bridging-Header
.Doing this I could call the class with
var example = <Project_name>.<className>