There is a object dragging and video recording in my app. I am using a ScreenCapture
view in my app. I am taking screenshots of main screen and making a video.
When I am using the following code in drawRect()
method of my ScreenCapture
view, the dragging becomes slow for iOS 6 and works fine for iOS 5:
[self performSelector:@selector(setNeedsDisplay) withObject:nil
afterDelay:delayRemaining > 0.0 ? delayRemaining : 0.01];
And when i replace that line of code with following code, the dragging works fine but gives a bad access:
[self performSelectorInBackground:@selector(setNeedsDisplay) withObject:nil];
What is the reason for this?