मैं एक UIImageView UIScrollView में रखा है, मूल रूप से इस UIImageView बहुत बड़ा नक्शा रखती है, और "तीर" के साथ एक पूर्वनिर्धारित मार्ग पर एनिमेशन बनाया बताया नेविगेशन दिशा।NSTimer निकाल नहीं जब UIScrollView घटना होती है
लेकिन, जब भी uiscrollevents होती है, तो मुझे लगता है कि MainLoop फ्रीज़ और NSTimer निकाल दिया नहीं किया जा रहा है, और एनीमेशन बंद कर दिया।
वहाँ किसी भी मौजूदा संपत्ति है, जो इस समस्या का हल, UIScrollView, CAKeyFrameAnimation या NSTimer पर?
//viewDidLoad
self.myTimer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(drawLines:) userInfo:nil repeats:YES];
- (void)drawLines:(NSTimer *)timer {
CALayer *arrow = [CALayer layer];
arrow.bounds = CGRectMake(0, 0, 5, 5);
arrow.position = CGPointMake(line.x1, line.y1);
arrow.contents = (id)([UIImage imageNamed:@"arrow.png"].CGImage);
[self.contentView.layer addSublayer:arrow];
CAKeyframeAnimation* animation = [CAKeyframeAnimation animation];
animation.path = path;
animation.duration = 1.0;
animation.rotationMode = kCAAnimationRotateAuto; // object auto rotates to follow the path
animation.repeatCount = 1;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
animation.fillMode = kCAFillModeForwards;
[arrow addAnimation:animation forKey:@"position"];
}
स्क्रॉलिंग के दौरान [UIScrollView एनएसटीमर को रोकता है] के संभावित डुप्लिकेट (http://stackoverflow.com/questions/7059366/uiscrollview-pauses-nstimer-while-scrolling) –