Somehow i can not change the properties of my custom object anymore. I used Xcode 6 to create my project and moved to XCode 7 now. It told me to "update to recommended settings" and i did it.
Object.h
@interface Object : NSObject <NSCoding>
@property (nonatomic, copy) NSString *ID;
ViewController.m
#import "Object.h"
@interface ViewController ()
@end
Object *myObject;
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
myObject = [[Object alloc] init];
}
- (IBAction)editProperty:(id)sender {
myObject.ID = _textfield.text;
NSLog(@"ID : %@",myObject.ID);
}
This all worked perfectly fine, but now myObject.ID
is always (null)
.....
When i write this code:
myObject.ID = _textfield.text;
NSLog(@"ID : %@",myObject.ID);
inside viewDidLoad it works...