tipop
tipop copied to clipboard
Get errors on iPad sometimes
The same code on the iPhone runs relatively smoothly, but on the iPad with the same code, I get the following error message every so often:
-[__NSCFArray insertObject:atIndex:]: index (27) beyond bounds (27) at animations.js (line 193)
Here is my code that i'm using to stop a spinning imageView and set it back to the correct position (which is triggering the error
POP.clear(navButton).spring(navButton,{rotate:{z:0}, delay:0,easing:'easeOutCubic'},function(){
Ti.API.info('[Spinning completed and image straightened out');
});
Hi @mark22 , tested it on my iOS10 - 5.5.0.GA - iPad Air 2 simulator with the code below, didn't met any problems:
var POP = require("guy.mcdooooo.tipop");
function doClick(e) {
POP
.clear( $.img )
.spring( $.img, {
rotate: {
z: 130
},
delay: 0,
duration: 600,
easing:'easeOutCubic'
});
}
function reset() {
POP
.clear( $.img )
.spring( $.img, {
rotate: {
z: 0
},
delay: 0,
duration: 600,
easing:'easeOutCubic'
}, function() {
Ti.API.info('Spinning completed and image straightened out');
});
}
$.index.open();
Is that the case you have?
McDo,
Its usually running perfectly fine. Its just that with regular daily use I notice that crash warning appearing more frequently on my iPad (actual device, not simulator). It happens sporadicly with no real pattern as to why its happening.
The context of how I'm using that code is that I have an image which spins while I download XHR data. When the XHR is complete I stop the spinning with the code I gave above. Which will clear the ongoing spinning and then rotate my image back to its 'normal' state.
To stop the spining I am using the exact reset() code you provided. But to start the spinning I am using the following:
POP
.clear(navButton)
.basic(navButton, {
rotate:{z:360},
duration:600,
delay: 0,
repeatForever:true,
}, function() {
});
This allows the image view to just spin continuously in a loop until I tell it to stop with the reset() call.
This is working totally fine about 90% of the time. But when I use the app heavily it will occasionally crash (once a day say) on the iPad. I really cannot find any pattern to it, so was reaching out to see if that error message means anything to you.
Thanks again for an incredible module!