Shinobi Controls (stopping a loop) iOS


I have noticed that a lot of the examples supplied with Shinobi Controls seem to crash if let to run ad infinitum. I want a way to limit the number of iterations a process will perform. I am running this off a timer so the screen updates in realtime.
The calcs are performed in a method called update, so I put in a control as follows:

-(void)doStuff {
if(loopCount >361){
[_timer invalidate];
_timer =nil;

This doesn’t quite work, but is there a way within Shinobi for handling this?


Which controls are you using, and are there any specific examples you note as crashing if left to run?

Also, my first thought on your code snippet is there isn’t a loop. I would’ve thought you want

    int loopCount = 0;
    } while (loopCount++ <= 360);

    [_timer invalidate];
    _timer = nil;


Open xCode and run the continuous sinewave example - leave it for about 20 mins and look at the debug Window. If it doesn’t do this for you let me know and I’ll e-mail you my error screen.  


I’ve just run the AppendData sample on the latest version of charts for about 30 minutes (20,000 datapoints) without any crashes, but if you email the debug to, we can try looking into it further. What version of Charts were you using, which iOS version, and was it a device or simulator?