this is my inherited class of UIView : MobileView
@interface MobileView : UIView {
IconView *icon1;
IconView *userCar;
id goTimer;
}
@property (nonatomic, retain) IconView *icon1;
@property (nonatomic, retain) IconView *userCar;
-(void) goRightInSeconds: (NSInteger)secs;
-(IconView *) cannon;
@end
I also have another class which inheritated UIView: IconView
@interface IconView : UIView {
UIImage *iconImage;
CGFloat originalX, originalY;
}
@property (nonatomic, retain) UIImage *iconImage;
-(id)initWithImage: (UIImage *)image andFrame:(CGRect) rect;
-(CGFloat) getX;
-(CGFloat) getY;
@end
Now, in another "main view" class which is also a subclass of UIVIew, I call this:
mobile = [[MobileView alloc] initWithFrame:CGRectMake(0, 100, 150, 150)];
***[mobile cannon]***
Now i have an error: [UIView cannon]: unrecognized selector sent to instance 0xd1ae00' (I still have the same error if I use [mobile icon1])
Why it doesn't regconize the mobile as a MobileView object but an UIView?