This is related to Using a protocol and a delegate and I have narrowed down the issue a bit
I have a NavigationController with two views that display correctly.
“GraphView” is a view in a ViewController called GraphViewController. In the object inspector
“GraphViewController” and “GraphView” each appear correctly in the Custom Class box for the ViewController and the View respectively.
However in GraphViewController I have put this code (below) in a setGraphView method and it is is never called. It is as if GraphViewController is not being set as GraphView’s GraphViewController.
The code I used is (I @synthesize GraphView further up)
- (void) setGraphView:(GraphView *)graphView {
_graphView = graphView;
self.graphView.dataSourceDelegate = self;
[self.graphView setNeedsDisplay];
NSLog(@"just set Graph View");
}
I never get the NSLog message, which I do in a similar (but working) application.
The comment about the link was a clue. I remade the link by ctrl dragging from the circular icon i the bar below the view into the GraphView View component, i.e the View componet iside the ViewController.
The inspector content remained exactly the same but it did the trick in that subsequently the code is running.