使用 RestKit 時會出現 SystemConfiguration framework not found in project 錯誤
來源 a
解法說明
https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ
簡單來說,找到 Prefix.pch, 加入
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h> // iOs 用
// Max OS X 用這行 or #import <CoreServices/CoreServices.h> for Mac OS X
I'm getting a a warning "SystemConfiguration framework not found in project", how do I fix this?
AFNetworking has optional dependencies of the SystemConfiguration and CoreServices / MobileCoreServices frameworks. While they are not required to use AFNetworking, their inclusion turns on network reachability monitoring and file MIME type detection on uploaded files, respectively. Not including them triggers a compiler warning. To include these frameworks in your project, and silence these warnings, do the following two things:
- Go to the "Build Phases" tab for your project target
- Under "Link Binary with Libraries", click the + button and add SystemConfiguration as well as MobileCoreServices on iOS, or CoreServices on Mac OS X.
- In your precompiled headers file, Prefix.pch, add the following lines under#import <Foundation/Foundation.h>:
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h> // or #import <CoreServices/CoreServices.h> for Mac OS X
沒有留言:
張貼留言