I’m trying to debug a problem I posted here: https://stackoverflow.com/questions/6852561/delegation-question-method-at-top-level-view. Basically it’s a class at the lower level that does not inherit directly from a method at the top level, my coworker had each class hold a reference to another class, to another class, to another class, so that way the bottom level class could call that method from the MainView class. The MainView class also does extra functionality when that method is performed such as, creating the new view, adding buttons to the appropriate toolbars, etc.
Before he was adding all views at once in an NSArray and hiding them and showing them when needed based on a segment control. I fixed that and added the views programmatically only when needed. It works, except for the ability to call the function at the MainView level. The assignments are still there such as
self.newViewController.ParentVC = self;
where newViewController is the lower level viewController I add to my subView. The ParentVC is of my current controller object type. When I set a break point, I see the memory value of self, but when I check the newViewController’s ParentVC value in the debugger, it keeps having 0x0 value. I’m not sure why it’s not getting set anymore and what the problem would be. Any thoughts? Thanks.
try tracing just past the assignment you mention and type the following in your debug console:
po [[self newViewController] ParentVC]
What does that print?