CADisplayLink declaration error

Ok, so I was completely at a standstill from this compiler error for several hours, and the problem is that all the googling that I did says that it should work the way I am! I am following an iPhone game development tutorial and I am stuck in the second chapter due to a random compiler error.

NOTIFICATION. I am currently launching and testing Xcode 4.1 using iOS 5 beta

Here's the announcement:

In the header file:

@interface GameController : NSObject
{
    CADisplayLink *displayLink;
}

@end

In the .m file

- (void)startGame {
    displayLink = [displayLinkWithTarget:self selector:@selector(update:)];  // THROWS ERROR
    [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];  // THROWS ERROR
}

- (void)update:(CADisplayLink *)sender {
    // TODO: actually do something..
}

Both of them cause an error: Receiver 'CADisplayLink' for class message - this is a forward declaration

But all messages on the Internet have the same string. Type of error - "Automatic error counting links."

Any help is much appreciated!

+5
2

#import <QuartzCore/QuartzCore.h> QuartzCore, .

+12

QuartzCore ?

CADisplayLink .

+3

All Articles