I passed string from controllerA (second item in tab bar) to controllerB (first item in tab bar), added that string to array and want to display it. I called reloadData but table view is still empty. What I have to do to get my string displayed in controllerB? (this two controllers are connected to two different navigation controllers and I don’t want to use seque).
here is some code:
//ControllerA
ControllerB *bController = [[ControllerB alloc]init];
bController.myString = self.cellLabel.text;
[tableController addButtonIsPressed];
//ControllerB.h
@property (copy, readwrite) NSString *myString;
//ControllerB.m
-(void)addButtonIsPressed {
[myData addObject:@"myString"]; //in NSLog I can see correct value of myString
[self.tableView reloadData];
}
Now I realized then When I print myData in console it is null. Even if i initialize myData with values in viewDidLoad in this method its (null)..
We need more information but the problem might be here :
You declare another Controller maybe it’s not the same controller who’s display.
Cause i don’t see any : [self displayModal ….]
You juste create a B controller with the correct “mystring” but you’re displaying another B controller.