![FBSDKApplicationDelegates
没有名为的成员 “应用程序”。
如何在Swift中处理此错误?
func application(application: UIApplication,
openURL url: NSURL,
sourceApplication: String?,
annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance.application(application,
openURL: url,
sourceApplication: sourceApplication,
annotation: annotation)
}
答案 0 :(得分:1)
像这样更新你的代码:
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
//Even though the Facebook SDK can make this determinitaion on its own,
//let's make sure that the facebook SDK only sees urls intended for it,
//facebook has enough info already!
let isFacebookURL = url.scheme != nil && url.scheme!.hasPrefix("fb\(FBSDKSettings.appID())") && url.host == "authorize"
if isFacebookURL {
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
return false
}
这样会更安全。
答案 1 :(得分:0)
你刚忘了()
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String, annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
答案 2 :(得分:0)
这是Parse中的一个错字(我猜),因为您的代码是他们在Facebook用户下发布的内容(请参阅:https://www.parse.com/docs/ios/guide#users-facebook-users)。
所以我同意Ashish(除了我会说' Parse'犯了错误!:)。
如果您输入' FBSDKApplicationDelegate.s' xcode会为您提供sharedInstance()'