Why NSClassFromString(@"CADisplayLink")?
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