I have a class called NetworkSection with a corresponding object created in IB. In the interface, I have one NSMatrix property called IVBSpecificationMenu. I would like to access that NSMatrix object through the ResultSection class, also initialized in IB.
It seems that I’m doing something wrong. I’ve created the property, linked the outlet to the NetworkSection object, imported the NetworkSection.h file, yet in the ResultSection implementation, the IVBSpecificationMenu object doesn’t seem to be available.
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
Is this the right way to access properties from another class?
I’m not sure if this helps…but what screams at me is the name of your variable in the line
IBOutlet NetworkSection *NetworkSection;of yourResultSectioninterface file.Maybe the variable name (
NetworkSection) is clashing with the type name (alsoNetworkSection). Try changing the variable name to something likenetworkSectionor_networkSection.