开发者

Connect one view to another in seperate NIBs using Interface Builder

I have a custom UIWindow class that has an IBOutlet

@interface MyWindow
    IBOutlet UIView * someView;
    id <MyWindowDelegate> delegate; 
    // to inform a controller something happened to view
开发者_StackOverflow中文版@end

@interface MyControllerThatContainsSomeView
    IBOutlet UIWebView * theConcreteView;
@end

I have changed my Window in MainWindow.xib to MyWindow. Is there a way, through interface builder, in which I can reference someView from MyControllerThatContainsSomeView.xib

so, MainWindow.MyWindow.someView -> MyControllerThatContainsSomeView.theConcreteView


You can refer to it in a binding path but that's about it. Usually when you find that you need to refer from one view to another, it's time to rethink your design. Views should refer instead to model objects which provide data to the views.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜