On 26 Jan 2017, at 19:06, Raglan T. Tiger <r...@crusaderrabbit.net> wrote:
> 
> According to the docs if one does:
> 
>   [ NSFontManager setFontManagerFactory:[ EFontManager class ] ];
> 
> before the main nib file is loaded and where EFontManager is a subclass of 
> NSFontManager and EFontManager does implement init as its designated 
> initializer.
> 
> My problem is that my init method for EFontManager is never called.

Are you running any other code before your -[NSFontManager 
setFontManagerFactory:] invocation?  Note that “any other code” may include 
e.g. constructor functions from libraries you’re linking with... while I 
wouldn’t expect system libraries to be invoking [NSFontManager 
sharedFontManager] at that point, it’s possible some third-party library does 
that.

I’d try moving it to near the start of your main() function and see if it 
starts working.  If it does, there’s probably some code somewhere that’s asking 
for the font manager early on.

The other thing you could do is, in the debugger, set a breakpoint on 
[NSFontManager sharedFontManager] then start your program and see what the 
backtrace looks like (that will tell you where the first invocation is; you’re 
going to have to ensure that you call -setFontManager: *prior* to that somehow).

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to