-1

I have LoginViewControllerIphone instance , where I push the instance of TasksRootViewControllerIphone

then in TasksRootViewControllerIphone (10 seconds after appearing) I call [self.navigationController popViewControllerAnimated:YES];

And receive an error:

[NSRecursiveLock isSystemItem]: unrecognized selector sent to instance 0x3ba360

I tried to print navigation controller stack:

po [self.navigationController viewControllers]
$2 = 0x003445f0 <__NSArrayI 0x3445f0>(
<LoginViewControllerIphone: 0x3b73c0>,
<TasksRootViewControllerIphone: 0x3af290>
)

So it has proper view controllers. Any ideas how can it happen?

update:

pushing code:

           self.tasksRootViewControllerIphone = [[TasksRootViewControllerIphone alloc] initWithNibName:@"TasksRootViewControllerIphone" bundle:nil];
            self.tasksRootViewControllerIphone.view.backgroundColor = [UIColor clearColor];
            [self.loginViewControllerIphone.navigationController pushViewController:self.tasksRootViewControllerIphone animated:YES];

in TasksRootViewControllerIphone.m I have:

- (void)viewDidLoad
{
    [self performSelector:@selector(popCurrentViewControllerAnimated) withObject:self afterDelay:10];
}

- (void)popCurrentViewControllerAnimated
{
    [self.navigationController popViewControllerAnimated:YES];
}
Paul T.
  • 4,938
  • 7
  • 45
  • 93

2 Answers2

1

Update your viewDidload Method as

 - (void)viewDidLoad
{
    [self performSelector:@selector(popCurrentViewControllerAnimated) withObject:nil afterDelay:10];
}

hopefully it solve your problem.

As the method popCurrentViewControllerAnimated not take any argument. so withObject should be nil. not self.

Siddiq
  • 393
  • 2
  • 8
  • what is new ? check question proper – kirti Chavda Sep 20 '13 at 06:49
  • @kirti As in question in viewDidLoad Method {[self performSelector:@selector(popCurrentViewControllerAnimated) withObject:self afterDelay:10];} which is wrong. – Siddiq Sep 20 '13 at 07:05
  • it's now wrong, because I have a separate method popCurrentViewControllerAnimated, and I use @selector(popCurrentViewControllerAnimated) – Paul T. Sep 20 '13 at 09:17
0

I found the point.

The problem was because it's not arc project, and one of the UIBarButtonItems was released one time more.

Strange, but it caused the problem with popViewController.

Paul T.
  • 4,938
  • 7
  • 45
  • 93