如何通过CocoaPods将CorePlot 2.3发布分支添加至当前构建
Hey there, I’ve run into this exact compatibility issue before—Xcode 9.2 tightened up nullable pointer checks, which clashes with the older CorePlot 2.2 codebase. The good news is the release-2.3 branch was specifically updated to handle these new Xcode rules, and installing it via CocoaPods is straightforward. Here’s how to do it:
First, prepare your Podfile:
If you don’t already have a Podfile in your project, open Terminal, navigate to your project’s root directory, and run:pod initUpdate your Podfile to target the 2.3 branch:
Open the generated Podfile (or your existing one) and replace any existing CorePlot line with this:pod 'CorePlot', :git => 'https://github.com/core-plot/core-plot.git', :branch => 'release-2.3'This tells CocoaPods to pull directly from the release-2.3 branch of the official CorePlot repo instead of the default 2.2 version.
Install the updated pod:
Save your Podfile, go back to Terminal, and run:pod install --repo-updateThe
--repo-updateflag ensures your local CocoaPods repo is up to date so it can find the latest branch changes.Open your project correctly:
After installation finishes, make sure to open your project using the.xcworkspacefile (not the old.xcodeprojfile)—this is required to include the CorePlot pod in your build.
If you run into any leftover errors from the old CorePlot version, try running pod deintegrate first to remove the old installation, then re-run pod install. That should clear up any lingering conflicts.
内容的提问来源于stack exchange,提问作者Anthony_b

