I get this cryptic error the first time (and only the first time) my view is loaded due to the following line of code:
- (void)viewWillAppear:(BOOL)animated
{
[textField becomeFirstResponder];
}
There is a noticeable (~3 – 4 second, even on the simulator) delay due to this that makes my app feel unresponsive. Does anyone know how to fix this? I can't find any documentation on it on Apple's site, or any solutions here or on Google.
Strangely, the opposite situation happens if I put the line in -viewDidAppear:
instead of -viewWillAppear:
; that is, instead of printing the error only the first time the keyboard is shown and never again, the error is not printed the first time but every time after. This is causing a major headache for me.
Override
-viewDidAppear:
, not-viewWillAppear
, and make sure to call[super viewDidAppear:]
. You should not perform animations when you are not on screen ("will appear"). And the-viewDidAppear:
docs explain that you must callsuper
because they have their own things to do.Alertview or actionsheets should be shown on main threads...so if your making any synchronous connections and performing that operation on another thread and showin alerts on the basis of output you received from that operation then you will get this error message wait_fences: failed to receive reply: 10004003 . You can do something like....
and show alerts in handleOutput method passing the output response string as the parameter.
See here for more info: http://www.iphonedevsdk.com/forum/iphone-sdk-development-advanced-discussion/17373-wait_fences-failed-receive-reply-10004003-a.html
Your problem is related.
After few tests the big rule is: "Do not perform animation before animated dismissal or animated show.".
For example:
-dismissModalViewControllerAnimated:YES
after the delegation callback of anUIAlertView -alertView:
will
DismissWithButtonIndex:
(wait the fade out of the alert view before doing this using the-alertView:
did
DismissWithButtonIndex:
callback)becomeFirstResponder
) before your view controller is on screen.Bad things may happen.
Hope it will be useful ;-)
You have done
[textfield becomeFirstResponder];
And after you get the value from textfield in your code, do
[textfield resignFirstResponder];
. That will help you, I think.override
viewDidappear
, notviewWillAppear
: