Created
March 20, 2015 13:05
-
-
Save fozoglu/41b52b87503e19ad536e to your computer and use it in GitHub Desktop.
NSNotification_Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import "FirstMenuViewController.h" | |
@interface ViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet UILabel *lblName; | |
@property (nonatomic, copy) NSString *Name; | |
@end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
@interface ViewController (){ | |
} | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showName) name:@"NameNotification" object:nil]; | |
} | |
- (void)didReceiveMemoryWarning { | |
[super didReceiveMemoryWarning]; | |
// Dispose of any resources that can be recreated. | |
} | |
-(void)showName{ | |
self.lblName.text = self.Name; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment