I am getting the following error and I am not sure what is causing it.
2011-02-06 23:38:12.580 SApp[9648:207] -[Record superview]: unrecognized selector sent to instance 0x5f2a350
2011-02-06 23:38:12.583 SApp[9648:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Record superview]: unrecognized selector sent to instance 0x5f2a350'
Steps that are creating the error:
- My custom class is being added to the
app delegate’s window. - My class is a subclass of UIViewController.
- In my custom class I am adding a subview (Record) which is another
subclass of UIViewController. – THIS
is when the error started happening.
Code that is causing the error:
[self.view addSubview:[self.tabBarControllers objectAtIndex:0]];
I have all my .h files included where they should be, so I am not sure what is causing this. And ideas?
You cannot add a
UIViewController(Record) as a subview of another view. Instead, add the view managed by that view controller as a subview.