I've googled around and found some answers but I didn't get any of them to work. I have one NSObject with the class "A" and a second class "B" without an NSObject. In class "A" are my IBOutlets defined and I can't seem to figure out how to access those outlets from class "B"...
I've found answered questions like http://forums.macrumors.com/archive/index.php/t-662717.html But they're confusing.
Any help would be greatly appreciated!
Simplified Version of the Code:
aClass.h:
#import <Cocoa/Cocoa.h>
@interface aClass : NSObject {
IBOutlet NSTextField *textField;
}
@end
aClass.m:
#import "aClass.h"
@implementation aClass
// Code doesn't matter
@end
bClass.h:
#import <Cocoa/Cocoa.h>
@interface bClass : NSObject {
}
@end
bClass.m:
#import "aClass.h"
#import "bClass.h"
@implementation bClass
[textField setStringValue: @"foo"];
@end
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…