CADisplayLink problem

Discussion in 'iOS Programming' started by exmorpheus, Mar 19, 2011.

  1. exmorpheus, Mar 19, 2011
    Last edited: Mar 19, 2011

    exmorpheus macrumors newbie

    Mar 19, 2011
    I want to animate some images and have this line:

    CADisplayLink *foo = [CADisplayLink displayLinkWithTarget:self selector:
    and I get this error message.

    ".objc_class_name_CADisplayLink", referenced from:
       literal-pointer@__OBJC@__cls_refs@CADisplayLink in fooClass.o
       symbol(s) not found
       collect2: ld returned 1 exit status
    I can only view this error in the build results and doesn't appear in the code window next to the code. So what gives?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    Have you included whatever framework CADisplayLink is declared in? In particular have you added it to your project? I suspect not as the error you are getting is from the linker indicating that it can't find the compiled code for that class in the frameworks it's linking with.
  3. exmorpheus thread starter macrumors newbie

    Mar 19, 2011
    yeah, I use the

    #import <QuartzCore/QuartzCore.h>
    before my code. Without it, I get a different error saying it can't find the declaration of CADisplayLink right there in the code next to the line.
  4. balamw Moderator


    Staff Member

    Aug 16, 2005
    New England
    That's not what robbieduncan was asking. It doesn't tell the linker where to find the object code for the framework.

    You need to add the framework to the project:

  5. exmorpheus thread starter macrumors newbie

    Mar 19, 2011
    Yep, that was it. Thanks. I thought that framework was a part of XCode and there was no importing necessary. But now I learned a thing or two about frameworks from this, thanks for the Apple link.

Share This Page