From my previous post, this is what I have so far in completing Exercise 2 to declare and implement a designated initializer. What am I doing wrong and how do I fix them?
- (id)initFirstName:(NSString *)firstNameValue initLastName:(NSString *)lastNameValue initDateOfBirth:(NSDate *)dateOfBirthValue {
[super init];
_firstName = firstNameValue;
_lastName = lastNameValue;
}
I'm getting an error that says "Expected method body" on the first line. On the line that assigns a value to _firstName I get an two errors, (1) "Use of undeclared identifier 'firstNameValue'", (2) "Instance variable '_firstName' accessed in class method".
I had declared the following properties and method in the .h file.
@property NSString *firstName;
@property NSString *lastName;
@property NSDate *dateOfBirth;
- (id)initFirstName:(NSString *)firstNameValue initLastName:(NSString *)lastNameValue initDateOfBirth:(NSDate *)dateOfBirthValue;