'弱'不能应用于非班级类型'<<错误类型>>' [英] 'weak' cannot be applied to non-class type '<< error type>>'

查看:200
本文介绍了'弱'不能应用于非班级类型'<<错误类型>>'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用git。在我使用git pull之后,我运行它并得到两个这样的错误。





我有导入MIBadgeButton_Swift。
我有一个带有一个MIBadgeButton对象的故事板。
我将一个连接拖到我的视图控制器。
错误:1.使用未声明的类型MIBadgeButton
2.'weak'无法应用于非类别类型'<<错误类型>>'
但其他人可以构建项目成功。那么为什么我会得到这个错误以及如何去除这个错误? 解决方案

您正在使用的按钮是放置在本地框架中?如果是这样,首先尝试重建框架,如果你不确定尝试下一步。



如果你说其他人都可以运行该项目,看起来你的编译文件夹弄得一团糟。您可以尝试此步骤以清除它。


  1. 从设备中移除应用程序
  2. 在Xcode内您的项目按 cmd + alt + shift + <$清理项目的派生数据(转到窗口>项目>不要按Delete,请按路径旁边的箭头,删除所有文件和文件夹)

现在,当你按下开始时,一个新的干净版本将被制作



更新
您提到您使用pod管理您的项目,请执行 pod过时 - 检查是否有任何豆荚已过期,您对大部分按钮感兴趣,如果是,请更新它。


We use git. After I used git pull, I run it and get two errors like this

I have import MIBadgeButton_Swift. I have a storyboard with a MIBadgeButton object. I drag a connection to my view controller. error:1.Use of undeclared type 'MIBadgeButton' 2.'weak' cannot be applied to non-class type '<< error type>>' But other guys can build project success. So why I am getting this error and how to remove this error?

解决方案

Is the button you are using placed in a local framework? if so try to rebuild the framework first, if you are not sure try next steps.

If you say that everybody else can run the project, it seems that your build folder got mess. You can try this steps in order to clean it

  1. Remove app from device
  2. In Xcode within your project press cmd + alt + shift + K
  3. Clean Derived data of the project (Go to window > Projects > Don't press Delete, press the arrow next to the path, remove all files and folders from there)

Now, when you will press start, a new and clean build will be made

Update you mentioned you use pods to manage your project, do a pod outdated - to check if there are any pods outdated, you are interested in the one with the button mostly, if so do an update on it

这篇关于'弱'不能应用于非班级类型'&lt;&lt;错误类型&gt;&gt;'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆