-2

I am getting this warning sometimes " wait_fences: failed to receive reply: 10004003 ", do not know why this is coming,

I do not have viewdidiappear method in my code, i have a UIAlert in my view, the code is

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Start" message:[NSString stringWithFormat:@"Hi %@,",[user objectAtIndex:0] ] delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
Srinivas
  • 400
  • 1
  • 11
  • I have searched but could not figure out thing, so i have put a Question here...do not give negative rating – Srinivas Jun 05 '12 at 06:38
  • Please take a look at this SO answer http://stackoverflow.com/questions/1371346/wait-fences-failed-to-receive-reply-10004003 – shabbirv Jun 05 '12 at 06:39
  • @ shabzco : nowhere in my code i am using a textfield, so what to do, could u help me out – Srinivas Jun 05 '12 at 06:49

2 Answers2

0

this is due to UI actions on a view controller on which you are not currently,i.e. the screen of which you are accessing UI, not visible currently.

Saad
  • 8,857
  • 2
  • 41
  • 51
  • Okay, So what solution can i give it, for not making the warning. – Srinivas Jun 05 '12 at 06:51
  • in init method, i have a method named next(), in that method i have the alert. – Srinivas Jun 05 '12 at 06:59
  • look, your init is invoked when you are going to make an object of that class not when you are on screen, which class u are using, is that uiviewcontroller subclass? – Saad Jun 05 '12 at 07:14
  • yeah and cleared it Thank u @The Saad, i am caling it from the previous class – Srinivas Jun 05 '12 at 08:22
0

if you read my answer in the comment you would understand, but what you need to do is add the above code in the -viewDidAppear method and make sure you add [super viewDidAppear:YES]; and if you want to keep it in your init method you'll have to add a delay like so
[self performSelector:@selector(next) withObject:nil afterDelay:0.5];

shabbirv
  • 8,958
  • 4
  • 33
  • 34
  • Could u tell me why is that happening and without delay can't we do that, i mean do we have any other method. – Srinivas Jun 05 '12 at 07:08
  • it happens because you are creating your AlertView before its parent/super view. I have given you an answer, I don't know what else you want. put it in your -viewDidAppear method and it will work. – shabbirv Jun 05 '12 at 07:10
  • yeah, the problem is that the same viewcontroller has lots of uiviews in it so, i guess the alert would create a problem if i keep in viewdidappear. – Srinivas Jun 05 '12 at 08:26