-
Notifications
You must be signed in to change notification settings - Fork 9
Installing RestKit v0.20.x via CocoaPods
- Update your Podfile to include
pod 'RestKit', '~> 0.24.0'
- Update your Pre-compiled Header File to include System Configuration, Core Services (OS X) or Mobile Core Services (iOS) and Core Data (if you are working with it).
Read below for more details.
CocoaPods is a dependency manager for iOS. It lets you specify and manage your 3rd-party library dependencies in a single text file (called a "Podfile"). CocoaPods uses a command-line executable ("pod"), and its end result is a new .xcworkspace based on your .xcodeproj, that already has all the 3rd-party code pulled in.
The process of using CocoaPods is typically:
- Create a Podfile and configure library dependencies.
- Execute
pod install
. - CocoaPods downloads the 3rd-party code and creates a new .xcworkspace.
- From now on, you use the .xcworkspace file to open your project in Xcode.
For more information on CocoaPods, see http://cocoapods.org/
gem install cocoapods
pod setup
Create the Podfile in the root of your Xcode project directory. Here's an example Podfile pulling in the latest RestKit:
platform :ios, '5.0'
# platform :osx, '10.7'
pod 'RestKit', '~> 0.20.0'
Note that if you are installing into an OS X app, you'll want to comment out the :ios
platform declaration and enable the :osx
platform declaration instead.
Do this from the root of your Xcode project directory, where your Podfile is.
pod install
You should now have a '.xcworkspace' file within your project directory. You will use this workspace going forward instead of the '.xcodeproj' file.
Open your project's precompiled header file within Xcode. This file is generally named after your project and has a '.pch' suffix. Add the following lines:
#import <Availability.h>
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#else
#import <SystemConfiguration/SystemConfiguration.h>
#import <CoreServices/CoreServices.h>
#endif
// If using Core Data, you may also wish to append
#import <CoreData/CoreData.h>
In case you still get errors and the Build fails, follow the following steps:
- In the Project Navigator on the left in your Xcode, click on the name of the project.
- Click on the name of your app in the 'Targets' header.
- Click on the 'Build Phases' tab.
- Expand the 'Link Binary With Libraries' and make sure you've added the following list of frameworks in case they are already not their in the list:
- MobileCoreServices.framework
- Security.framework
- CFNetwork.framework
- SystemConfiguration.framework
- CoreData.framework
- UIKit.framework
- Foundation.framework
- CoreGraphics.framework
If you run into any issues with a CocoaPods based installation out of the box the most likely cause is that project or target contains configuration that is overriding the settings provided via CocoaPods. CocoaPods works by adding a .xcconfig
file that contains configuration aggregated from the Pods you have installed. If you augment these configuration settings within your target, you have to be sure to include the $(inherited)
value to pick up the values provided by CocoaPods.
Please be check the following settings for overridden configuration and add the $(inherited)
if necessary:
- OTHER_LDFLAGS
- HEADER_SEARCH_PATHS