With the following code, both items in the array are the same (the last item). What am I doing wrong that is causing this array to overwrite the values? I'm trying to use 1 object so I don't have to instantiate X number of objects.
self.myArray = [[NSMutableArray alloc] init];
MyObjClass *obj = [[MyObjClass alloc] init];
obj.firstName = @"First Name";
obj.lastName = @"Last Name";
obj.created = @"Dec 17 16:24";
[self.myArray addObject:obj];
obj.firstName = @"First Name2";
obj.lastName = @"Last Name2";
obj.created = @"Dec 18 7:41";
[self.myArray addObject:obj];
In MyObjClass.h I have @interface MyObjClass : NSObject. Is NSObject the wrong datatype?
Properties in MyObjClass.h:
@property (strong) NSString *firstName;
@property (strong) NSString *lastName;
And from MyObjClass.m:
@synthesize firstName, lastName;