Good afternoon, I study xcode It is required to add for visual components. theme attribute. I wrote the following class, but I don’t understand how to create getter and setter correctly for working with an instance variable of an object. As I understand it, the _theme variable that I declared is static. Thank you @ "Max Mikheyenko" for information: Restrictions on creating categories: Impossible to create variables! The question remains: how to add setter and getter theme to work with User defined run time attributes in Xcode?
NSView.h
#import <Cocoa/Cocoa.h> @interface NSView (FrameworkAdditions) @property (nonatomic, assign) IBInspectable NSString *theme; - (void) changeTheme; @end NSView.m
#import "NSView.h" @implementation NSView(FrameworkAdditions) NSString * _theme; -(void) setTheme:(NSString *)theme { _theme = theme; [self changeTheme]; } -(NSString *) theme{ return _theme; } - (void) changeTheme { NSLog(@"Get %@ %@", [self theme], self.view); } @end