I have an issue the dismissing view controller to the tabbed view controller. I will explain my flow.
- view controller to tabbed view controller(push)
I have 5 tabs in the tabbed view controller in the 3 tabbed i have an camera view from their i am presenting the view controller and passing some parameters by using this code
UIStoryboard *storybord=[UIStoryboard storyboardWithName:@"Main" bundle:nil]; shareViewController *shareview=[storybord instantiateViewControllerWithIdentifier:@"share"]; [self presentViewController:shareview animated:YES completion:nil]; //shareview.finalvideourl=videoURL; shareview.videooutputstring=videoPath;
from the share view controller I want send the data back to the 1st tab for this I am using the below code
UIStoryboard *story=[UIStoryboard storyboardWithName:@"Main" bundle:nil]; TabedfirstViewController *Tabedfirst=[story instantiateViewControllerWithIdentifier:@"id"]; UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:Tabedfirst]; [self presentViewController: nc animated:YES completion:^{ [[NSNotificationCenter defaultCenter] postNotificationName:@"ShareArray" object:_selectedimgarray]; [[NSNotificationCenter defaultCenter] postNotificationName:@"SharetitleArray" object:_newtile]; [[NSNotificationCenter defaultCenter] postNotificationName:@"sharevideooutputstring" object:_videooutputstring]; }];
When I do this very thing working good I am sending the data from share view to the tabbed view and I am printing it.
The problem is when I send the second time data from share viewcontroller to the tabbed view controller first data is deleting and the second passed data is replacing the first i.e. I have the 15 objects in an array, from share view controller I am passing array to the tabbed view controller now the array count is 16 and I am printing it, now again I am passing one more object from the share view to tabbed view the array count must increase to 17 but it 16 only.