0

I create single view application with 1) Story board 2) ARC and 3) Unit Testing. In view controller i drag on UIButton. and ViewContrller embedded with Navigation Controller (Using Interface). It run fine in when i simply run the application, But when i run the application test case target then it aries problem.

enter image description here

vc is ViewController Object which i declare in .h file. and createPDFBtn is the object of UIButton.

Which thing i missing?

RahulSalvikar
  • 658
  • 1
  • 10
  • 31

1 Answers1

0

You are trying to call createPDFBtn on your view controller (self.vc). Since you do not have a method with this name you get an error message:

unrecognized selector sent to instance

Three possible problems and their solutions:

  • You may be calling the method on the wrong object - is vc your right object?
  • vc is correct but you do not have the createPDFBtn method implemented - implement the method.
  • you have implementet createPDFBtn in your vc object - is it a public or a private method? Is it in your .h file ?
Pfitz
  • 7,336
  • 4
  • 38
  • 51