• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why NSClassFromString(@"CADisplayLink")?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why NSClassFromString(@"CADisplayLink")?


  • Subject: Why NSClassFromString(@"CADisplayLink")?
  • From: Brian Bruinewoud <email@hidden>
  • Date: Tue, 10 May 2011 20:34:11 +1000

Hi All,

Just curious, why does this work (compiles and runs):

    displayLink = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget: tapped selector:@selector(respond:)];

But this doesn't link because the CADisplayLink class is missing:

    displayLink = [CADisplayLink                       displayLinkWithTarget: tapped selector:@selector(respond:)];

??

Link error is:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CADisplayLink", referenced from:
      objc-class-ref in drawingViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

Using XCode 4.0 and the iPad simulator. I suppose if I compiled for ARM the error might go away (but I don't have provisioning profile so I can't test that). Still, the code still runs so it must be able to link at run time even if it can't at compile time, which seems strange.

Anyway, just curious.

Regards,
Brian.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why NSClassFromString(@"CADisplayLink")?
      • From: Brian Bruinewoud <email@hidden>
    • Re: Why NSClassFromString(@"CADisplayLink")?
      • From: Wim Lewis <email@hidden>
    • Re: Why NSClassFromString(@"CADisplayLink")?
      • From: David Duncan <email@hidden>
    • Re: Why NSClassFromString(@"CADisplayLink")?
      • From: "Hank Heijink (Mailinglists)" <email@hidden>
  • Prev by Date: Re: NSControl Subclass and First Responder
  • Next by Date: Re: transitionWithView:duration:options:animations:completion: still defeats me
  • Previous by thread: Re: setState has no effect on an NSButton
  • Next by thread: Re: Why NSClassFromString(@"CADisplayLink")?
  • Index(es):
    • Date
    • Thread