I am using CTFontManagerRegisterGraphicsFont to register CGFont loaded at runtime from various sources (files, memory, ..), but some fonts raises an Exception with the following message:
Exception: "*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]"
an alternative to CTFontManagerRegisterGraphicsFont is CTFontManagerRegisterFontsForURL:
using this function I did not have any exception raised.
My Questions:
- What is the cause of this behavior difference
- How to catch & discard the exception raised by
CTFontManagerRegisterGraphicsFont - Is there any thing to be done before calling
CTFontManagerRegisterGraphicsFontto prevent the exception. - What
.persistentscope mean for 2nd parameter inCTFontManagerRegisterFontsForURL.