I would like to create an NSObject class that I can use the instance of and save to its variables and later pass its data elsewhere (NSManagedObject). Do I need to do anything else besides creating a new Object-C Class that inherits from NSObject. Create Variables in .h and synthesize in .m.
i.e.: my .h file:
#import <Foundation/Foundation.h>
@interface MyDataClass : NSObject
@property (nonatomic, retain) NSNumber *variable1
@property (nonatomic, retain) NSString *variable2
@property (nonatomic, retain) NSDate *variable3
@end
.m file:
#import "MyDataClass.h"
@implementation MyDataClass
@synthesize variable1, variable2, variable3
@end
I would like to be able do the following in some SomeViewController:
@property (nonatomic, strong) MyDataClass *newDataClass
@systhesize newDataClass;
newDataClass.variable1 = @"123457890";
newDataClass.variable2 = @"This is the new Variable";
newDataClass.variable3 = [NSDate date];
Is there anything else I need to do to initialize each variable when an instance of this class is created? Am I missing anything?