![](/img/trans.png)
[英]Facebook Login Swift don't works On Device (But do on IOS Simulator)
[英]iOS swift facebook login button is not showing up if i don't use classForCoder
我正在尝试将Facebook单点登录集成到我的iOS应用程序之一。 我遵循了Facebook的指示,当我尝试运行该应用程序时,出现以下错误
Unknown class FBSDKLoginButton in Interface Builder file.
在网上搜索后,我发现添加以下代码可以解决该问题。
FBSDKLoginButton.classForCoder()
我的问题是,此代码的重要意义是什么? 这在后台执行什么操作?
从苹果的基金会框架参考 :
classForCoder
是Overridden by subclasses to substitute a class other than its own during coding. (read-only)
Overridden by subclasses to substitute a class other than its own during coding. (read-only)
This method is invoked by NSCoder. NSObject's implementation returns the receiver's class. The private subclasses of a class cluster substitute the name of their public superclass when being archived.
声明书 :
var classForCoder: AnyClass { get }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.