I set an incompatible pointer type, but the code works ok. I want to know the reason. X1 is the exact copy of X2 code.
@interface ViewController : UIViewController
@property(retain,nonatomic) X1 *testProperty;
@end
// ###############################
@implementation ViewController
@synthesize testProperty;
- (void)viewDidLoad {
[super viewDidLoad];
testProperty = [X2 new]; --> Warning
[testProperty printLog];
}
}
The warning is: Incompatible pointer types assigning to
This warning is obvious, but my problem is how this code works ok? does it cast it?