Ok i am adding a bit more info to answer vince
In class A: post a notice
[[NSNotificationCenter defaultCenter] postNotificationName:@"DataUpdated" object:arrayOfPurchasedObjects];
In class B: first register for a notification and write a way to handle it.
You give the appropriate selector to the method. Make sure your class B is assigned before you send a notification, another notification will not work.
- (void) viewDidLoad { // view did load [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleUpdatedData:) name:@"DataUpdated" object:nil]; } -(void)handleUpdatedData:(NSNotification *)notification { NSLog(@"recieved"); NSArray *purchased = [notification object]; [classBTableDataSourceArray addObjectsFromArray:purchased]; [self.tableView reloadData]; } - (void) dealloc { // view did load [[NSNotificationCenter defaultCenter] removeObserver:self name:@"DataUpdated" object:nil]; [super dealloc]; }
source share