0

我想让我的视图转换为从右向左滑动,而不是通常的从左向右滑动。所以我找到了这段代码:

- (void) imgSlideInFromLeft : (UIView *) view
{
    CATransition *transition = [CATransition animation];
    transition.duration = 0.4;
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionPush;
    transition.subtype =kCATransitionFromLeft;
    transition.delegate = self;
    [view.layer addAnimation:transition forKey:nil];
}

然后我添加了 QuartzCore 的框架并导入<QuartzCore/QuartzCore.h>了,但我现在得到了这些错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CAMediaTimingFunction", referenced from:
      objc-class-ref in SearchResultsController.o
  "_OBJC_CLASS_$_CATransition", referenced from:
      objc-class-ref in SearchResultsController.o
  "_kCAMediaTimingFunctionEaseInEaseOut", referenced from:
      -[SearchResultsController imgSlideInFromLeft:] in SearchResultsController.o
  "_kCATransitionFromLeft", referenced from:
      -[SearchResultsController imgSlideInFromLeft:] in SearchResultsController.o
  "_kCATransitionPush", referenced from:
      -[SearchResultsController imgSlideInFromLeft:] in SearchResultsController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
4

1 回答 1

5

看起来您忘记了添加QuartzCore.framework到您的应用程序?

于 2013-02-21T13:32:51.643 回答