简体   繁体   English

“弱”不能应用于非类类型“ <<错误类型>>”

[英]'weak' cannot be applied to non-class type '<< error type>>'

We use git. 我们使用git。 After I used git pull, I run it and get two errors like this 使用git pull之后,我运行它并得到两个错误,例如

在此处输入图片说明

I have import MIBadgeButton_Swift. 我已导入MIBadgeButton_Swift。 I have a storyboard with a MIBadgeButton object. 我有一个带有MIBadgeButton对象的情节提要。 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. 错误:1。使用未声明类型的“ MIBadgeButton”2。“弱”不能应用于非类类型“ <<错误类型>>”,但是其他人可以使项目成功。 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 在项目中的Xcode中,按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) 清除项目的派生数据(转到窗口>项目>不要按Delete,按路径旁边的箭头,从此处删除所有文件和文件夹)

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 更新您提到的您使用Pod来管理您的项目,做一个pod outdatedpod outdated检查是否有任何过时的Pod,您对按钮最感兴趣的是Pod,如果是,则对其进行更新

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

相关问题 Alamofire:“弱”不能应用于非类类型错误 - Alamofire: 'weak' cannot be applied to non-class type error xcode 7类型参数不能应用于非参数化类 - xcode 7 Type arguments cannot be applied to non-parameterized class 在针对 iOS 8.4 SDK 使用 Crashlytics 3.3.4 构建时,类型参数不能应用于非参数化类“NSDictionary” - Type arguments cannot be applied to non-parameterized class 'NSDictionary' when using Crashlytics 3.3.4 building against iOS 8.4 SDK swift:弱不能应用于插座 - swift: weak cannot be applied to an outlet 要求非等级成员 - Request for member which is of non-class Swift-二进制运算符不能应用于类型的操作数 - Swift - Binary operator cannot be applied to operands of type 二进制运算符“ +”不能应用于“ CGRect”和“ Double”类型 - Binary Operator '+' cannot be applied to type 'CGRect' and 'Double' 二元运算符“&lt;^&gt;”不能应用于类型的操作数 - Binary operator '<^>' cannot be applied to operands of type “二进制运算符&#39;〜=&#39;不能应用于类型的操作数&#39; - "Binary operator '~=' cannot be applied to operands of type ' 二进制运算符&#39;!=&#39;不能应用于“ UIImage”类型的操作数 - Binary operator '!=' cannot be applied to operands of type “UIImage”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM