我一直在探索Core Plot版本1.5.1提供的Plot_Gallery-iOS项目,特别是RealTimePlot示例。我在模拟器中测试了应用程序,包括iPhone和iPad,以及这些模拟器的64位版本。然后我在iPhone上运行项目,一切都按预期进行。当我在iPad Air上运行项目时出现问题。实时绘图的第一部分工作正常,但是,绘图的范围不会更新。但是,数据正在更新,因为点被移动,直到轴保持为空。
我为项目添加了一个异常断点,它在NSParameterAssert(range)
的方法setXRange:
中的CPTXYPlotSpace.m
停止:
-(void)setXRange:(CPTPlotRange *)range
{
NSParameterAssert(range);
if ( ![range isEqualToRange:xRange] ) {
CPTPlotRange *constrainedRange;
if ( self.allowsMomentumX ) {
constrainedRange = range;
}
else {
constrainedRange = [self constrainRange:range toGlobalRange:self.globalXRange];
}
id<CPTPlotSpaceDelegate> theDelegate = self.delegate;
if ( [theDelegate respondsToSelector:@selector(plotSpace:willChangePlotRangeTo:forCoordinate:)] ) {
constrainedRange = [theDelegate plotSpace:self willChangePlotRangeTo:constrainedRange forCoordinate:CPTCoordinateX];
}
if ( ![constrainedRange isEqualToRange:xRange] ) {
[xRange release];
xRange = [constrainedRange copy];
[[NSNotificationCenter defaultCenter] postNotificationName:CPTPlotSpaceCoordinateMappingDidChangeNotification
object:self];
if ( [theDelegate respondsToSelector:@selector(plotSpace:didChangePlotRangeForCoordinate:)] ) {
[theDelegate plotSpace:self didChangePlotRangeForCoordinate:CPTCoordinateX];
}
CPTGraph *theGraph = self.graph;
if ( theGraph ) {
[[NSNotificationCenter defaultCenter] postNotificationName:CPTGraphNeedsRedrawNotification
object:theGraph];
}
}
}
}
部署目标是7.1,其他项目配置是项目附带的配置。关于为什么会发生这种情况的任何线索?
更新 这是异常之前的堆栈跟踪:
2014-03-21 15:11:48.794 Plot Gallery[209:60b] Stack trace : (
0 Plot Gallery 0x0000000100150094 -[CPTXYPlotSpace setXRange:] + 56
1 Plot Gallery 0x00000001001a705c -[CPTAnimation update:] + 3040
2 Foundation 0x000000018a2c15c4 __NSFireTimer + 92
3 CoreFoundation 0x00000001896fef54 <redacted> + 28
4 CoreFoundation 0x00000001896febc4 <redacted> + 804
5 CoreFoundation 0x00000001896fc8ec <redacted> + 1324
6 CoreFoundation 0x000000018963d6d0 CFRunLoopRunSpecific + 452
7 GraphicsServices 0x000000018f2c9c0c GSEventRunModal + 168
8 UIKit 0x000000018c76efdc UIApplicationMain + 1156
9 Plot Gallery 0x00000001000def54 main + 56
10 libdyld.dylib 0x00000001965e7aa0 <redacted> + 4
)
2014-03-21 15:12:02.358 Plot Gallery[209:60b] *** Assertion failure in -[CPTXYPlotSpace setXRange:], /Users/myUser/Developer/iOS/core_plot/framework/Source/CPTXYPlotSpace.m:378