2013年3月7日 星期四

使用 RestKit 時會出現 SystemConfiguration framework not found in project 錯誤

使用 RestKit 時會出現 SystemConfiguration framework not found in project 錯誤

來源 a

http://rdkw.wordpress.com/2012/12/05/afnetworking-causes-systemconfiguration-framework-not-found-in-xcode-project/

解法說明

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:

  1. Go to the "Build Phases" tab for your project target
  2. Under "Link Binary with Libraries", click the + button and add SystemConfiguration as well as MobileCoreServices on iOS, or CoreServices on Mac OS X.
  3. 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

沒有留言: