Suppose dummy VC has a private property "image"
dummyVC.h
@interface dummyVC : UIViewController
@end
dummyVC.m
@interface dummyVC ()
@property (nonatomic, strong) UIImage *image;
@end
- (void)setImage:(UIImage *)image
{
if(!_image) { // compiler tells me _image is a 'undeclared indentifier'
//do something
}
}
If I try to use _image
in its setter, the compiler tells me I am using undeclared identifier
.
However, if I change the property name to image1
or anotherImage
. There is no problem using _image1
and _anotherImage
.
Can anybody explain why this happened?