i have a problem with accessing value from the NSTExtField in different class here is the code:
AppDelegate.h
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSTextField *numberOfPhrases;
@end
AppDelegate.m
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize numberOfPhrases;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSLog(@"%@",[numberOfPhrases stringValue]);
}
TestClass.h
@interface TestClass : NSObject
- (IBAction)doSomething:(id)sender;
@end
TestClass.m
@implementation TestClass
- (IBAction)doSomething:(id)sender {
NSLog(@"%@",[numberOfPhrases stringValue]); ?????????
}