Таким образом, я получаю неполную ошибку реализации в файле square.m. Я включил файлы .h и .m. Также в моем классе UIView, когда я создаю объект (Квадрат) и вызываю метод визуализации, изображение не будет отображаться.Неполная реализация в файле
Square.h файл, только в случае, может быть ошибка:
#import <Foundation/Foundation.h>
#import "Texture2D.h"
@interface Square : NSObject
{
Texture2D *image;
CGPoint draw;
int xDir, yDir, x, y;
CGRect rect;
bool alive;
}
-(id) init;
-(void) setPosition;
-(void) setDirection;
-(Texture2D *) getImage;
-(CGRect) getRect;
-(void) update;
-(void) render;
@end
Square.m файл реализации (Это где ошибка):
#import "Square.h"
@implementation Square : NSObject //here is the error line
-(id) init{
x = 200;
y = 200;
image = [[Texture2D alloc] initWithImage:[UIImage imageNamed:@"circle.png"]];
alive = true;
rect = CGRectMake(x, y, 18, 18);
draw = CGPointMake((CGFloat)x, (CGFloat)y);
return self;
}
-(void) setDirection: (int) xDirection: (int) yDirection{
xDir = xDirection;
yDir = yDirection;
}
-(void) setPosition: (int) xx: (int) yy{
x = xx;
y = yy;
}
-(CGRect) getRect{
return rect;
}
-(Texture2D *) getImage{
return image;
}
-(void) update{
}
-(void) render{
[image drawAtPoint: draw];
}
@end