Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy can't I do any CABasicAnimation or Keyframe animation stuff?
    primarykey
    data
    text
    <p>For some reason Xcode tells me that it doesn't find symbols as soon as I use something like kCAFillModeForwards. There must be a library or class that I have to include...but which one? The normal Core Animation stuff works fine like [myView beginAnimations...]. What's the trick to get the more sophisticated animation stuff to work?</p> <p>I've included in the .h file:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import &lt;QuartzCore/QuartzCore.h&gt; @interface TestClass : UIView { } // ... </code></pre> <p>I run this code:</p> <pre><code>- (void)testAnimation { CABasicAnimation *fadeInAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; [fadeInAnimation setToValue:[NSNumber numberWithFloat:1.0]]; fadeInAnimation.fillMode = kCAFillModeForwards; fadeInAnimation.removedOnCompletion = NO; // other stuff deleted to limit error possibilities...should at least compile } </code></pre> <p>This happens when I build (did clean up lots of times), 2 Errors:</p> <pre><code> cd "/Users/thanks/Desktop/Thanks/iPhone Development/TestApp" setenv MACOSX_DEPLOYMENT_TARGET 10.5 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk "-L/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/Debug-iphonesimulator" "-F/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/Debug-iphonesimulator" -filelist "/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/TestApp.build/Debug-iphonesimulator/TestApp.build/Objects-normal/i386/TestApp.LinkFileList" -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -o "/Users/thanks/Desktop/Thanks/iPhone Development/TestApp/build/Debug-iphonesimulator/TestApp.app/TestApp" Undefined symbols: ".objc_class_name_CABasicAnimation", referenced from: literal-pointer@__OBJC@__cls_refs@CABasicAnimation in TestClassTestClass.o "_kCAFillModeForwards", referenced from: _kCAFillModeForwards$non_lazy_ptr in TestClass.o ld: symbol(s) not found collect2: ld returned 1 exit status ".objc_class_name_CABasicAnimation", referenced from: literal-pointer@__OBJC@__cls_refs@CABasicAnimation in TestClass.o "_kCAFillModeForwards", referenced from: _kCAFillModeForwards$non_lazy_ptr in TestClass.o ld: symbol(s) not found collect2: ld returned 1 exit status </code></pre> <p>It says <strong>Undefined symbols:</strong></p> <p>Must I include some framework?</p> <p>I have already included:</p> <p>CoreGraphics.framework Foundation.framework UIKit.framework</p> <p>When I remove all the code, but import QuartzCore/QuartzCore.h, then I don't get any error. So I bet that import works, but not sure.</p> <p><strong>SOLVED</strong></p> <p>I missed to include the QuartzCore framework!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload