问题
I'm working on building a Swift iOS app, and integrating CorePlot via CocoaPods. Things are working pretty well, but I'm running into a problem where I'm unable to call certain methods in a CorePlot class. I'm not sure if this is a compiler bug or if I'm not understanding the way the methods map over.
Basically, I have this variable called xRange, and I'm casting as CPTMutablePlotRange, then attempting to call the expandRangeByFactor method on it, but XCode is complaining that it isn't found.
The documentation for CPTMutablePlotRange is here:
http://core-plot.github.io/iOS/interface_c_p_t_mutable_plot_range.html
I'm using v1.5.1 via cocoapods, and the header for the class is here:
https://github.com/core-plot/core-plot/blob/release_1.5.1/framework/Source/CPTMutablePlotRange.h
It looks to me like the method should work, but it's just not finding it. I've also verified by browsing the code in the Pods directory that the header is the same.
I've also added the CorePlot stuff to the bridging header (as I mentioned, things are working in general, just not this method call).
Here's a screenshot of the error in XCode (I'm using XCode 6 beta 5):
来源:https://stackoverflow.com/questions/25170579/coreplot-swift-method-not-found