0

i am using TabBarController , it is working fine in my ipod.

but my application is crashing it 3.0 . any help please?

self.window.rootViewController = self.tabBarController; //crashing here

and log shows

-[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -    
[UIWindow setRootViewController:]: unrecognized selector sent to instance 0x127c80'
Legolas
  • 12,145
  • 12
  • 79
  • 132
PJR
  • 13,052
  • 13
  • 64
  • 104

2 Answers2

2

This may show you the right direction. Let me know if the problem still continues.

Due to executing on different versions of iOS, that method may have deprecated.

Community
  • 1
  • 1
alloc_iNit
  • 5,173
  • 2
  • 26
  • 54
2

The crash is because you're calling a method that doesn't exist, not because your variables are not initialized.

-setRootViewController doesn't exist prior to iOS 4.0. Use

[self.window addSubview:self.tabBarController.view];

instead.

Or, update your target platfor to 4.0.2 or later. It's probably less than 5% of users that aren't using iOS 4 at this point.

Seamus Campbell
  • 17,816
  • 3
  • 52
  • 60