【发布时间】:2012-09-06 20:52:52
【问题描述】:
这与Using a protocol and a delegate 有关,我已将问题范围缩小了一点
我有一个带有两个正确显示视图的 NavigationController。
“GraphView”是一个名为 GraphViewController 的 ViewController 中的视图。在对象检查器中 “GraphViewController”和“GraphView”分别正确显示在 ViewController 和 View 的自定义类框中。
但是,在 GraphViewController 中,我已将此代码(如下)放在 setGraphView 方法中,并且它从未被调用。好像 GraphViewController 没有被设置为 GraphView 的 GraphViewController。
我使用的代码是(我@synthesize GraphView 进一步向上)
- (void) setGraphView:(GraphView *)graphView {
_graphView = graphView;
self.graphView.dataSourceDelegate = self;
[self.graphView setNeedsDisplay];
NSLog(@"just set Graph View");
}
我从来没有收到过 NSLog 消息,我在一个类似(但可以工作)的应用程序中这样做。
【问题讨论】:
-
您是否在 Connection Inspector 中进行了实际连接?
-
你能描述一下吗?究竟是那个过程?
-
在我看到的图形视图控制器中,First Responder,图形视图控制器 - GraphViewController、View、GraphView、导航项 - 图形查看器以及导航控制器和我的根视图控制器的条目
-
看我的回答,谢谢建议
标签: model-view-controller view xcode4 viewcontroller