Я делаю приложение OpenGL, но получаю сообщение EXC_BAD_ACCESS.
Вот мой код:
//(draw function only, ask if you need more)
//objects: array of triangles/quads
//Triangle/Quad3D: should be obvious, I like OOP
//PS this is in a 'Composite Object' class
- (void)draw {
//NSLog(@"%@",objects);
NSMutableArray *quad, *tri;
quad = [NSMutableArray arrayWithCapacity:0];
tri = [NSMutableArray arrayWithCapacity:0];
NSEnumerator *e = [objects objectEnumerator];
id object;
while (object = [e nextObject]) {
if ([object isKindOfClass:[Triangle3D class]]) {
[tri addObject:(Triangle3D *)object];
} else if ([object isKindOfClass:[Quad3D class]]) {
[quad addObject:(Quad3D *)object];
}
}
NSLog(@"%d",[tri count]);
NSLog(@"%d",[quad count]);
[quad release];
[tri release];
[e release];
}