我继续收到以下错误:
duplicate symbol _llvm.embedded.module in:
/Users/name/Documents/FacebookSDKs-iOS-20150910/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKApplicationDelegate.o)
/Users/name/Documents/FacebookSDKs-iOS-20150910/FBSDKCoreKit.framework/FBSDKCoreKit(FBSDKServerConfiguration.o)
ld: 102 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
我已经尝试删除FBSDK并重新安装,但这没有用.我还怀疑我将框架桥接到Swift这一事实可能是个问题.我的桥接头包含以下内容:
#ifndef EggCrush_Bridge_h
#define EggCrush_Bridge_h
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#endif
Run Code Online (Sandbox Code Playgroud)
我的AppDelegate.swift文件导入FBSDKCoreKit.
没有其他链接器标志.
我正在运行Xcode 6.3.2并为iOS 8.3构建项目
如何清除此错误?
我知道Angular 6中必须创建单例服务的方式已经发生了一些变化。我有一个身份验证服务,需要为访问它的每个组件构造一次。我将提供程序设置为服务的根目录:
@Injectable({
providedIn: 'root'
})Run Code Online (Sandbox Code Playgroud)
在我的app.module.ts文件中,我将AuthService设置为NgModule中的提供程序之一。但是,每当我在使用Auth服务的不同组件之间路由时,它都会创建Auth Service的新实例(从第一次调用它时清除数据)。如何确保仅将Auth Service实例化一次,然后在不同组件之间访问该实例?
我想在处理数据时处理数据,所以我已经开始像这样开发一个URL会话:
let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: operationQueue);
Run Code Online (Sandbox Code Playgroud)
我还将类设置为URLSessionDataDelegate:
class ViewController: UITableViewController, URLSessionDataDelegate{
Run Code Online (Sandbox Code Playgroud)
最后,我实现了didReceive数据函数,如下所示:
func urlSession(_ session: URLSession,
dataTask: URLSessionDataTask,
didReceive data: Data){
print(data)
}
Run Code Online (Sandbox Code Playgroud)
但是,永远不会调用该函数.
我像这样运行我的会话:
let session1 = session.dataTask(with: url) { (data, response, error) in
print(data!);
}
Run Code Online (Sandbox Code Playgroud)
它打印来自回调的数据,但不打印来自委托的数据.任何帮助是极大的赞赏.
编辑:我还添加了以下内容:
func urlSession(_ session: URLSession,
dataTask: URLSessionDataTask,
didReceive response: URLResponse,
completionHandler: @escaping (URLSession.ResponseDisposition) -> Void){
completionHandler(URLSession.ResponseDisposition.allow);
}
Run Code Online (Sandbox Code Playgroud)
但是,委托方法仍未被调用.