I'm trying to use buttons to change the text on text view but i keep getting errors with this method
AppDelegate.h
AppDelegate.m
but i keep getting errors:
synthesizing__weak instance variable of type NSTextview*', which does not support weak references
property 'stringValue' not found on object of NSTextview
and if i change
to
everything works but i can't link it with text view it only links with text fields and labels
AppDelegate.h
PHP:
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@property (weak) IBOutlet NSButton *button1;
@property (weak) IBOutlet NSButton *button2;
@property (weak) IBOutlet NSButton *button3;
@property (weak) IBOutlet NSTextView*textfield;
AppDelegate.m
PHP:
#import "AppDelegate.h"
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
}
- (IBAction)button1:(id)sender{
_textfield.stringValue = @"exampletext1";
}
- (IBAction)button2:(id)sender{
_textfield.stringValue = @"exampletext2";
}
- (IBAction)button3:(id)sender{
_textfield.stringValue = @"exampletext3";
}
but i keep getting errors:
Code:
@property (weak) IBOutlet NSTextView*textfield;
Code:
- (IBAction)button1:(id)sender{
_textfield.stringValue = @"exampletext3";
}
- (IBAction)button2:(id)sender{
_textfield.stringValue = @"exampletext2";
}
- (IBAction)button3:(id)sender{
_textfield.stringValue = @"exampletext3";
}
property 'stringValue' not found on object of NSTextview
and if i change
Code:
@property (weak) IBOutlet NSTextView*textfield;
to
Code:
@property (weak) IBOutlet NSTextField *textfield;
everything works but i can't link it with text view it only links with text fields and labels