0

My application has two classes: exampleAppDelegate and exampleController.

I import exampleController.h into exampleAppDelegate.m and exampleAppDelegate.h into exampleController.m.

When I try to use outlet or action from exampleController class in exampleAppDelegate class, the compiler returns the following error:

use undeclared identifier and action not found.

The same problem happens when I try to use the variable from exampleAppDelegate in exampleController.

What am I doing wrong?

Nikolai Nagornyi
  • 1,312
  • 2
  • 11
  • 26
  • 2
    Class names should start w/capital letters, btw. – bbum Jun 14 '11 at 17:49
  • 1
    [solution 1](http://stackoverflow.com/questions/2228242/how-to-access-string-variable-in-one-view-controller-to-another-view-controller) [solution 2](http://stackoverflow.com/questions/2548910/how-do-i-access-variable-values-from-one-view-controller-in-another) [solution 3](http://stackoverflow.com/questions/1685964/how-to-pass-a-string-value-from-one-view-controller-to-another-view-controller) [solution 4](http://stackoverflow.com/questions/6166376/how-do-i-access-a-variable-in-one-view-controller-from-another-view-controller) [solution 5](http://stackoverflow.com/questions/3008967) – Aravindhan Jun 14 '11 at 17:47

1 Answers1

0

If you want to use same methods/selectors for events (like UIControlEventTouchDown ...) across multiple files, try adding them using addTarget:action:forControlEvents: method instead of doing through IBAction (interface builder).
Also , I dont think your approach of importing delegate in controller is correct.

Tatvamasi
  • 2,537
  • 19
  • 14