Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation bug with real time plots in iPad running iOS 7.1 #77

Closed
alcamla opened this issue Mar 28, 2014 · 5 comments
Closed

Animation bug with real time plots in iPad running iOS 7.1 #77

alcamla opened this issue Mar 28, 2014 · 5 comments

Comments

@alcamla
Copy link

alcamla commented Mar 28, 2014

have been exploring the project Plot_Gallery-iOS supplied with Core Plot release 1.5.1, specifically the RealTimePlot example. I tested the app in the simulators, both iPhone and iPad, also on the 64bit versions of these simulators. Then I ran the project on the iPhone, and everything went as expected. The problem occurred when I ran the project on an iPad Air. The first part of the real time plot works fine, but then, the range of the plot is not updated. The data is being updated, though, because the points are shifted, until the axes are left empty. I added an exception break point to the project, and it stops on NSParameterAssert(range) in the method setXRange: of the 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];
            }
        }
    }
}

This is the stack trace before the exception:

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
@eskroch eskroch added Bug and removed Priority-Low labels Mar 29, 2014
@eskroch eskroch self-assigned this Mar 29, 2014
@eskroch
Copy link
Member

eskroch commented Mar 29, 2014

Can you checkout the latest code from Github and give it a try? I merged the release-2.0 branch into master after the 1.5.1 release. This changed the animation code to use GCD instead of a timer. Please let me know if the new animation code still exhibits this problem.

@alcamla
Copy link
Author

alcamla commented Mar 31, 2014

Hi Eric, the new version does not exhibit the problem. The Real Time plot now behaves as expected both in iPad and iPhone, running iOS 7.1. Thanks a lot for solving this!

@eskroch eskroch closed this as completed Mar 31, 2014
@ghost
Copy link

ghost commented Jul 24, 2014

I'm running into the same issue, however updating to HEAD in my Podfile results in numerous ARC related issues.
Any other ideas on how to fix or work around this problem?

@eskroch
Copy link
Member

eskroch commented Jul 24, 2014

Read the comments on issue #95.

@ghost
Copy link

ghost commented Jul 25, 2014

Thanks for pointing me to the right direction.

Yesterday, I was able to work around the ARC issues myself by adding -fobjc-arc to individual files' compiler flags. However, I stopped when I ran into the vDSP_Length issue. Did not realize both issues were already reported.

Using

pod 'CorePlot', :podspec => 'https://raw.githubusercontent.com/edwardaux/core-plot/master/CorePlot.podspec.json'

as per #95 (comment) and #87 (comment) for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants