NSInvalidArgumentException - XCode 6.0.1

108 views Asked by At

I realize this error has been discussed many times on stackoverflow, but I'm still not sure what I'm missing. Here's the console output:

Unknown class CRBarGraphController in Interface Builder file.
2014-11-18 18:40:05.796 Test[7319:60b] -[UIImageView start2]: unrecognized selector sent to instance 0x16562ac0
2014-11-18 18:40:06.256 Test[7319:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView start2]: unrecognized selector sent to instance 0x16562ac0'

CRBarGraphController.m defines a function (void)start2; also declared in the interface for CRBarGraphController.h.

start2 is called from CRGraphViewController.m using the following code:

-(void)viewWillAppear:(BOOL)animated {
    self.navigationController.navigationBarHidden = NO;
    [self.bar_Graph start2];
}

where, bar_Graph is an object of CRBarGraphController, declared in CRGraphViewController.h as:

@property (weak, nonatomic) IBOutlet CRBarGraphController *bar_Graph;

CRGraphViewController.h does import CRBarGraphController.h Also, in the storyboard, bar_Graph outlet is set to class, CRBarGraphController.

Why does XCode still think bar_Graph is an instance of UIImageView and not CRBarGraphComtroller? I included an exception breakpoint to make sure the exception originates from where start2 is being called.

0

There are 0 answers