【发布时间】:2014-04-04 15:09:58
【问题描述】:
我想加载我的 windowController 的 nib 文件。
我正在从 AppDelegate 调用 windowController 类
-(IBAction)test:id(sender)
{
//Loading the WindowController Class
Test1 *wc = [[Test1 alloc]init]alloc];
[wc showWindow:self];
/*Some code Changes done*/
/*Changes done to add value to the text Field of the Window Controller*/
}
为了获取 Window Controller XIB 的值,进行了一些更改,
在 Test1Class 中,使用以下方法检索值:
- (id)initWithWindow:(NSWindow *)window
{
//Code added to retrieve the Text Field data
}
但是当窗口启动时所做的更改没有得到反映。
但是当放置断点时,值被设置但没有显示在TextField上,但是在XIB中IBOutlet已经连接到NSTextField,因为IBoutlet值没有被设置。
提前致谢!!!
【问题讨论】:
-
你能说得更具体些吗?如果我理解了,您想从视图控制器 2 更新视图控制器 1 吗?
-
实际上我正在 Appdelegate 中设置值并尝试将其设置为窗口。我在 WindowControllerClass 中编写代码
标签: objective-c macos cocoa