Why does CTFontCreateWithName != NULL on iPhone OS 3.1.3?
- by Tony
I am following the instructions in the Apple dev docs: http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-1114537
In this case, I'm trying to conditionally execute code, depending on whether or not CTFontCreateWithName is defined. Here is what I've reduced my test case down to:
if (CTFontCreateWithName != NULL)
NSLog(@"CTFontCreateWithName = %p", CTFontCreateWithName);
This prints "CTFontCreateWithName = 0x0", which suggests that it's both NULL and not NULL at the same time. Even though CTFontCreateWithName != NULL evaluates to true, I get an error saying it can't resolve the symbol _CTFontCreateWithName once it gets to the line that uses it. Any ideas? Is %p not the correct way to print out the address of a function?
For what it's worth, the example in their docs, UIGraphicsBeginPDFPage != NULL, evaluates to false, so it works for that one.