title: iOS NSNotification Simple Xcode Project Problems
body: <p>I'm now learning notification programming, have a very simple project have two classes that have a little problems that dont't call notification selector method when posting notification. That's very weird, hope someone help me find where problems occurred, i'm very appreciated that!</p>
  
  <p>My source code:</p>
  
  <p>ViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface ViewController : UIViewController
  
  @property (weak, nonatomic) IBOutlet UIButton *pushButton;
  
  - (IBAction)presentViewController:(id)sender;
  
  @end
  </code></pre>
  
  <p>ViewController.m</p>
  
  <pre><code>#import "ViewController.h"
  #import "ViewController2.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
  }
  
  - (IBAction)presentViewController:(id)sender
  {
      [[NSNotificationCenter defaultCenter] postNotificationName:@"networkNotification"
                                                          object:self];
      ViewController2 *viewController2 = [self.storyboard instantiateViewControllerWithIdentifier:@"viewController2"];
      [self presentViewController:viewController2
                         animated:YES
                       completion:nil];
  }
  
  @end
  </code></pre>
  
  <p>ViewController2.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @class ViewController;
  
  @interface ViewController2 : UIViewController
  
  @property (weak, nonatomic) IBOutlet UILabel *testLabel;
  @property (nonatomic, strong) ViewController *viewController;
  
  @end
  </code></pre>
  
  <p>ViewController2.m</p>
  
  <pre><code>#import "ViewController2.h"
  #import "ViewController.h"
  
  @interface ViewController2 ()
  
  @end
  
  @implementation ViewController2
  
  @synthesize testLabel;
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      self.viewController = [[ViewController alloc] init];
      [[NSNotificationCenter defaultCenter] addObserver:self
                                               selector:@selector(recievingNotifications:)
                                                   name:@"networkNotification"
                                                 object:self.viewController];
  }
  
  - (void)recievingNotifications:(NSNotification *)aNotification
  {
      if ([[aNotification name] isEqualToString:@"networkNotification"])
      {
          [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
          self.testLabel.text = @"Good";
      }
  }
  
  - (void)dealloc
  {
      [[NSNotificationCenter defaultCenter] removeObserver:self
                                                      name:@"networkNotification"
                                                    object:self.viewController];
  }
  
  @end
  </code></pre>