I have created standard Page-Based application in xCode 4.2.1
I need to change ModelController.m
It has method -
for each page this method create new DataViewController
I want to use only one DataViewController instance for all page in this application. To change method
viewControllerAtIndex like this:
But this does not work correctly.
Thanks for advance.
I need to change ModelController.m
It has method -
Code:
- (DataViewController *)viewControllerAtIndex:(NSUInteger)index storyboard:(UIStoryboard *)storyboard;
for each page this method create new DataViewController
Code:
DataViewController *dataViewController = [storyboard instantiateViewControllerWithIdentifier:@"DataViewController"];
I want to use only one DataViewController instance for all page in this application. To change method
viewControllerAtIndex like this:
Code:
if (dataViewController == NULL) {
dataViewController = [storyboard instantiateViewControllerWithIdentifier:@"DataViewController"];
}
dataViewController.dataObject = [self.pageData objectAtIndex:index];
But this does not work correctly.
Thanks for advance.