NSNotification addObserver:someOtherClass
<p>I need to pass a message up to a controlling class (which creates an instance of the class which will be sending the message) So, I cannot directly reference the class name in my file, without either making it a Global (which is ridiculous to do if "NSNotification" advertises to be able to pass all kinds of messages, regardless of where / what class they are.</p>

<p>So without further ado...</p>

<blockquote>
  <p>(calling from Say ClassB)</p>
  
  <p>ClassA creates instance of ClassB</p>
</blockquote>

<p>Now in <code>ClassB</code>, I need to pass messages regarding button presses back up to <code>ClassA</code></p>

<pre><code>(insdie ClassB)
- (void)viewDidLoad
{
  [[NSNotificationCenter defaultCenter] addObserver:ClassA 
                                        selector:@selector(doLoginAction)      
                                        name:@"SomeButton" 
                                        object:nil];
  [super viewDidLoad];
}
</code></pre>

<p>This will NOT compile, even when I include, sorry, <code>"#import "ClassA.h"</code>
Now if I do something stupid like,</p>

<pre><code>ClassA *classa = [[ClassA alloc]init];
</code></pre>

<p>and then use this Newly created instance of classa in <code>addObserver:classa</code> it will compile, but as I thought, will do absolutely nothing... (I knew that, but surprisingly this kind of code is prevalent in Iphone programming books...) So I tried it anyway.</p>

<p>But if I put this function in <code>ClassA</code> and use <code>addObserver:ClassB</code>
it will get called, but will cause a stack dump <code>unrecognized selector sent to instance</code> 
or use <code>addObserver:self</code>.</p>

<p>I am tempted to delete Xcode and go back to vim and use a good old "C" callback...</p>
