This thing can be easily done if you pass the link of the current class to the next class and change the values using this link.
How: The class to click.
@interface B:UIViewController{ id delegate; } @property (nonatomic,retain) id delegate; @end @implementation B @synthesize delegate; -(void)methodA{ [delegate setNewString2:@"Madhup"]; } @end
The class from which you press B:
@interface A:UIViewController{ NSString *newString; } @property (nonatomic,retain) NSString *newString; @end @implementation A @synthesize newString - (void)method2{ B *newBObject = .......; [newBObject setDelegate:self]; [self.navigationController pushViewCo.......]; } @end
Hope this helps.
source share