Update - Many people are insisting I need to declare an iVar for the property. Some are saying not so, as I am using Modern Runtime (64 bit). I can confirm that I have bee
I'm seeing error: 'testString' undeclared (first use in this function) when the @synthesize is just before the testing method. The error disappears if I move the @synthesize below the method implementation. This might be because the TestB class doesn't have a testProp string instance variable to use with the declared property. (In the Legacy (32-bit) runtime, you must declare instance variables to use for properties — in Modern runtime (64-bit Mac, iPhone) they can be inferred, so declaring them is optional.) Is it possible that you meant to name the property testString instead?
EDIT: In GCC 4.2, it works if you change TestB.h to the following:
#import "TestA.h"
@interface TestB : TestA {
NSString *testProp; // <-- Adding this fixes the errors
}
@property NSString *testProp;
@end
However, using the Clang-LLVM compiler, the code works unmodified. Perhaps this is a bug to file.