@Anomie and @jlehr are correct, the C function has no idea about the FontManager object and its current state, it just lives in one file.
However, if the FontManager is singleton, and you create the fontRef property (or create an accessor for it), then you can access the value in your C class:
static int CstyleMethod() { FontManager *fm = [FontManager sharedManager]; NSUInteger emSize = CGFontGetUnitsPerEm(fm.fontRef); }
On the bottom line, you can combine and map the syntax of C and ObjC inside C functions and ObjC methods. But since C functions do not have a default reference to self (and instance variables associated with the object), you can only reference ObjC objects that are single, stored in a global variable, or passed as parameters.
source share