views:

70

answers:

1

I have a class like this

@interface MyParentClass : NSObject {
    NSString *objectName_;
}
@property(nonatomic, copy) NSString *objectName;
@end

and in implementation, I have this:

@implementation MyParentClass
@synthesize objectName = objectName_;
@end

then I have a child class that inherits from MyParentClass like this

@interface MyChildClass : MyParentClass {
}
@end

the problem is that if I create a child class object and try to access the objectName property, it gives me a no method found warning i.e.

MyChildClass *obj = [[MyChildClass alloc] init];
[obj setObjectName:@"BuzzLightYear"]; // this line produces no method 
                                      // setObjectName found warning

how can I remove it?

A: 

oops. just realized I had forgotten to #import "MyChildClass.h" in the file where I was using the buggy code. adding the import fixes the issue.

malik