Why does CTFontCreateWithName != NULL on iPhone OS 3.1.3?

Posted by Tony on Stack Overflow See other posts from Stack Overflow or by Tony
Published on 2010-05-03T17:02:38Z Indexed on 2010/05/03 17:08 UTC
Read the original article Hit count: 579

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk