views:

117

answers:

1

here is the code I am referring to:

NSArray *views = [[NSArray alloc] initWithObjects:addPVC, nil];



UITabBarController *aTBC = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
self.initialTBC = aTBC;

initialTBC.viewControllers = [NSArray arrayWithObjects:aController, aController2, nil];

[self.view addSubview:initialTBC.view];
[aTBC release];

When I use the line initialTBC.viewControllers = [NSArray arrayWithObjects:aController, aController2, nil]; or if I were to try to assign it to an array I have already made containing the view controllers I get this error in the console:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil'

Thanks in advance for any help you can provide.

A: 

I found out the problem, I was trying to use a Tab Bar Controller when I should have just been using and instance of UITabBar instead.

Ron Dear