I'm creating a TableViewController in a class named ResourcesTableViewController. I'm creating the class with:
ViewController.h:
@interface ViewController : UIViewController {
ResourcesTableViewController *resourceTableViewController;
ViewController.m:
resourceTableViewController = [[ResourcesTableViewController alloc] initWithStyle:UITableViewStylePlain];
[resourceTableViewController setTableViewObject:localObject];
Now I can work with it and I can call
NSLog(@"%@ %@",resourceTableViewController,[resourceTableViewController tableViewObject]);
at several parts in my ViewController.m with (as expected) the same output
<ResourcesTableViewController: 0x749f1c0> tableViewObjectContent
. For switching on the new TableView I created in the storyboard a button with the popover to the new view (as triggered segue). But as soon as the button is pressed and the view shall appear, it creates a new instance. Curiously I put in the viewDidLoad of my class ResourcesTableViewController:
NSLog(@"viewDidLoad: %@: %@", self, self.tableViewObject);
and it is returning
<ResourcesTableViewController: 0x74bbcd0>: (null)
. Another memory adress, another instance. Not the instance I worked with before and absolutely not the instance to which I gave that tableViewOject. How can I call the view from that instance belonging to the resourceTableViewController I created and worked with? I still can access that "old" instance through communicating with the object resourceTableViewController but the created view is another one of that type that certainly doesn't make use from the object I gave to the first one.