0
我有一個名爲NetworkSection
的類,在IB中創建了相應的對象。在界面中,我有一個名爲IVBSpecificationMenu
的NSMatrix屬性。我想通過ResultSection類來訪問該NSMatrix對象,並在IB中初始化。訪問IB中創建的對象的屬性 - Cocoa
看來我做錯了什麼。我創建了屬性,將出口鏈接到NetworkSection對象,導入NetworkSection.h文件,但在ResultSection實現中,IVBSpecificationMenu對象似乎不可用。
Section.h:
#import <Foundation/Foundation.h>
@interface NetworkSection : NSObjectController {
IBOutlet NSTextField *IVBhostPerNetwork;
IBOutlet NSTextField *IVBamountOfNetworks;
}
@property (retain) IBOutlet NSMatrix *IVBSpecificationMenu;
- (IBAction)enableSpecificationTextField:(id)sender;
@end
ResultSection.h:
#import <Foundation/Foundation.h>
#import "NetworkSection.h"
@interface ResultSection : NSObjectController{
IBOutlet NetworkSection *NetworkSection;
}
- (IBAction)CalculateResults:(id)sender;
- (void)SpecificationSection;
- (void)subnetMaskSection;
@end
這是從另一個類的訪問屬性的正確方法?
哇,這解決了問題!非常感謝! – Cubia