I am really new to Objective-C and when I was practicing the book exercises, I really am stuck here. Please help me solve this and I have been thinking what could cause thi
It looks like you are testing inheritance so I will assume that XYZShout
is supposed to be derived from XYZPerson
. If so follow the suggestion from @JFS and make sure it does actually derive:
XYZShout.h:
#import
#import "XYZPerson.h"
@interface XYZShout : XYZPerson
- (void)saySomething:(NSString *)greet;
@end
And also correct the definition of saySomething
in XYZPerson
(you missed off the parameter):
XYZPerson.h:
#import
@interface XYZPerson : NSObject
@property NSString *firstName;
@property NSString *secondName;
@property NSDate *dob;
- (void)saySomething:(NSString *)greet;
// ^^^^^^^^^^^^^^^^^
- (void)sayHello;
@end