0
votes

I have the following code:

CATextLayer *test = [CATextLayer layer];
test.string = summary;
test.wrapped = YES;
//test.truncationMode = kCATruncationEnd;
//test.alignmentMode = kCAAlignmentJustified;
test.frame = s;
[test drawInContext:context];

I import the framework and link against it, however when it links I get the following error:

ld: warning: in /Users/ryansully/Desktop/AppName/Project/1/AppName/QuartzCore.framework/QuartzCore, missing required architecture i386 in file Undefined symbols:
"_OBJC_CLASS_$_CATextLayer", referenced from: objc-class-ref-to-CATextLayer in StoriesCell.o ld: symbol(s) not found collect2: ld returned 1 exit status

This is for an iOS project. I get this error in both XCode 3.2.3 and XCode 4 DP2.

2
Are you sure you're importing QuartzCore.framework, and you have #import <QuartzCore/QuartzCore.h> in your code? - jtbandes
Yes, I am 100% sure. I checked this multiple times as per direction by IRC :P - Ryan Sullivan
Tried creating a new project and putting it in? - jtbandes

2 Answers

2
votes

I had the same issue. I resolved it by adding the framework somewhere in the project properties.

In the project properties (in the Project Navigator in the left of XCode interface, click on the project): Targets/[your project's name]/Build Phases/Link Binary With Librairies.

Then add QuartzCore.h (there is a "+" button at the bottom of the list).

1
votes

Turns out XCode 4 is still buggy and can't add Frameworks appropriately. The issue was solved by opening the project in XCode 3, removing + readding the framework, then compiling.