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

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

    Code:
    CADisplayLink *foo = [CADisplayLink displayLinkWithTarget:self selector:
                                        @selector(fooMethod)];
    
    and I get this error message.

    Code:
    ".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

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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

    Joined:
    Mar 19, 2011
    #3
    yeah, I use the

    Code:
    #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

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
    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:

    http://developer.apple.com/library/...ks.html#//apple_ref/doc/uid/20002257-BAJJBBHJ

    B
     
  5. exmorpheus thread starter macrumors newbie

    Joined:
    Mar 19, 2011
    #5
    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