So I know there's a lot of questions regarding this, but so far as I can tell this is a unique situation so I figured I would post it. Hopefully, this will add some info that may finally give us an answer as to why this is happening to us. I'm getting the error: wait_fences: failed to receive reply: 10004003, when my device rotates. The animation of my views are initiated from:
- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
I'm only getting the error on the new iPad 3. I've used the exact same program on an original iPad and iPhones as low as a 3GS. They all don't get the wait_fences error and they all rotate faster than the iPad 3 does.
I use Core Graphics almost exclusively to draw the views. I also ensure they're redrawn on a resize so I don't get pixilated views. If I disable the redraw on resize, I don't get this error (but I get stretched views). If I disable core graphics drawing altogether I don't get the error (but, of course, I get black views).
I used the Time Profiler and found out that the hangup was primarily in drawing gradients:
I have altered the code to fill rather than draw gradients and that does alleviate the problem. I would say that the gradients are the problem except I do these animations in other situations (other than in response to rotation) and it works just fine.
I would also like to note that I've paid special attention to making sure I only animate views that are actually on the screen. I know that animating views off screen can sometimes cause this error to occur.
I have not included the animation code
Any ideas as to why this is happening? Especially since it's only happening on the iPad 3?
For those who will ask, this is the code that performs the animation. It will normally be wrapped in a UIView Animation Block.
- (void) setFramesForFocusView:(CustomControl *)focusView atX:(CGFloat)x showInput:(BOOL)showInput{
CGSize bSize = self.bounds.size;
CGRect fRect = focusView.frame;
fRect.size.width = bSize.width;
CGRect iRect;
if (focusView.inputViewIsSystemKeyboard){
if (_keyboardRect.origin.y < 0 || _keyboardRect.origin.y >= CGRectGetMaxY(self.bounds) || CGRectIsEmpty(_keyboardRect) || CGRectGetMaxY(_keyboardRect) > CGRectGetMaxY(self.bounds)) return;
iRect = _keyboardRect;
} else {
iRect = (focusView.inputUIView && showInput) ? CGRectMake(0, bSize.height / 2, bSize.width, bSize.height / 2) : CGRectZero;
}
CGRect iaRect = focusView.inputAccessoryUIView.frame;
CGFloat availableFieldHeight = iRect.origin.y - iaRect.size.height;
iRect.size.width = bSize.width;
iaRect.size.width = bSize.width;
if (!showInput){
iRect.origin.y = bSize.height;
}
iaRect.origin.y = iRect.origin.y - iaRect.size.height;
iRect.origin.x = x;
iaRect.origin.x = x;
focusView.inputUIView.frame = iRect;
focusView.inputAccessoryUIView.frame = iaRect;
if (focusView.expandInput){
fRect.origin.y = 0;
fRect.size.height = availableFieldHeight;
} else {
if (focusView.labelPlacement != LabelPlacementTop && focusView.labelPlacement != LabelPlacementBottom){
fRect.size.height = _currentView.storedFrame.size.height + [focusView.label.text sizeWithFont:focusView.label.font].height;
}
fRect.origin.y = availableFieldHeight - fRect.size.height;
}
if (fRect.size.height > availableFieldHeight){
fRect.origin.y = 0;
fRect.size.height = availableFieldHeight;
}
fRect.origin.x = x;
[focusView setLabelPlacement:LabelPlacementTop toFrame:fRect];
}