I had something like the following code in a project I recently worked on.
@interface DetailsViewController : UIViewContoller {
UIView* headerView_;
}
@property (nonatomic, retain) UIView* headerView;
@end
@implementation DetailsViewController
@synthesize headerView = undefinedVariableName_;
// ...
@end
undefinedVariableName_
was not defined anywhere in the project and was actually a much less obvious typo.
This compiled perfectly fine (no errors or warnings) and even ran fine on iOS 4. I did not catch this error until the program crashed on 3.1.3 firmware.
Does anyone know if the above behaviour is considered undefined? Is there a way to have the compiler catch such mistakes?