My app started crashing lately I need some help to figure it out why.
In the app delegate I create a navigation controller
UINavigationController *localNavigationController;
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity:3];
And then load into 3 controllers (1 shown)
SecondViewController *secondViewController;
secondViewController = [[SecondViewController alloc] initWithTabBar];
localNavigationController = [[UINavigationController alloc]
[initWithRootViewController:secondViewController];
[localControllersArray addObject:localNavigationController];
[localNavigationController release];
[secondViewController release];
One of the view has a button that calls an action that pushes a new view
Ref *third = [[Ref alloc] initWithNibName:@"Fourthview" bundle:nil];
so far so good. I have updated an older xib that now I want to use but the app is crashes as soon as it pushed
Sup *third = [[Sup alloc] initWithNibName:@"Fifthview" bundle:nil];
If I go to IB and disconnect all UILabel Outlet it will work. But connecting for example pName will crash
Here’s the error
‘[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key pName.’
thanks
The class
Sup, which is being used to load theFifthviewXIB, must have either a property or an ivar namedpName. This is probably due to an IBOutlet in the XIB that connects apNameproperty to File’s Owner.The XIB loading process is attempting to use KVC to connect all of the IBOutlets defined in the XIB, which in practice means it’s calling
-[setValue:forKey:]where the key is equal to@"pName". If you already have apNameproperty declared inSup, make sure you also have@synthesize pName;somewhere in the implementation inSup.m.