Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSString *string1;
- @property(nonatomic,retain) NSString *string1;
- @synthesize string1;
- string1=@"Hello Every One";
- NSString *string2;
- @property(nonatomic,retain)NSString *string2;
- @synthesize string2;
- [vc1 setString1:[vc2 string2]];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(aChangeStringMethod:) name:@"anyStringJustMakeItUnique" object:nil];
- -(void)aChangeStringMethod:(NSNotification)notification{
- string1 = [((ViewController2 *)[notification object]) string2];
- }
- [[NSNotificationCenter defaultCenter] postNotificationName:@"anyStringJustMakeItUnique" withObject:self];
- [[NSNotificationCenter defaultCenter] postNotificationName:@"anyStringJustMakeItUnique" withObject:vc2];
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(launchTheOtherNotificationMethod:) name:@"anotherNotificationName" object:nil];
- -(void)launchTheOtherNotificationMethod:(NSNotification)notification{
- [[NSNotificationCenter defaultCenter] postNotificationName:@"anyStringJustMakeItUnique" withObject:self];
- }
- [[NSNotificationCenter defaultCenter] postNotificationName:@"anotherNotificationName" withObject:nil];
- string1 = [myVC2 string2];
- [vc1 setString1:[[vc1 myVC2] string2]];
- [[vc2 myVC1] setString1:[vc2 string2]];
- [[self parentViewController] setString1:string2]
Add Comment
Please, Sign In to add comment