I am new with Objective C and iPhone development but that is what I am trying to do... Problem is with QuartzCore and basic animation stuff. These lines are from my applicationDelegate
:
#import "QuartzCore/QuartzCore.h"
...
-(void)performTransition {
if(!transitioning) {
CATransition *transition = [CATransition animation];
transition.duration = 0.9;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = (isInMainDialog) ? kCATransitionFromRight : kCATransitionFromLeft;
transitioning = YES;
transition.delegate = self;
[window.layer addAnimation:tr开发者_开发知识库ansition forKey:nil];
if (isInMainDialog) {
mainController.view.hidden = YES;
levelController.view.hidden = NO;
isInMainDialog = false;
// start game
[levelController playLevel:1 balls:3 scores:0];
}
else {
mainController.view.hidden = NO;
levelController.view.hidden = YES;
isInMainDialog = true;
}
}
}
okay.. This applicationDelegate compiles ok, but when building following errors happen:
"_kCATransitionFromRight", referenced from: _kCATransitionFromRight$non_lazy_ptr in eBreakAppDelegate.o
"_kCAMediaTimingFunctionEaseInEaseOut", referenced from: _kCAMediaTimingFunctionEaseInEaseOut$non_lazy_ptr in eBreakAppDelegate.o
"_kCATransitionMoveIn", referenced from: _kCATransitionMoveIn$non_lazy_ptr in eBreakAppDelegate.o
".objc_class_name_CAMediaTimingFunction", referenced from: literal-pointer@__OBJC@__cls_refs@CAMediaTimingFunction in eBreakAppDelegate.o
"_kCATransitionFromLeft", referenced from: _kCATransitionFromLeft$non_lazy_ptr in eBreakAppDelegate.o
".objc_class_name_CATransition", referenced from: literal-pointer@__OBJC@__cls_refs@CATransition in eBreakAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
So, I guess there is a problem in linking, because there is no problems at compile time. Should I, some how, link the quartz to my project or how could this be fixed?
you have to add QuartzCore.framework to your target:
- right click on application target;
- click on [Get Info] in contextual menu;
- in [General] tab there's gonna be two lists, one for dependencies, other for Linked libraries;
- add QuartzCore framework to the botom one.
You need to make sure that QuartzCore is added to your project then change this line:
#import "QuartzCore/QuartzCore.h"
to:
#import <QuartzCore/QuartzCore.h>
The quotations tell the linker to look in the project source files. The '< >' tell it to look for frameworks.
精彩评论