• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSFontSetChangedNotification posted 20 times!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSFontSetChangedNotification posted 20 times!


  • Subject: NSFontSetChangedNotification posted 20 times!
  • From: Jérome Laurens <email@hidden>
  • Date: Fri, 6 Apr 2007 11:31:53 +0200

Hi,

I have got a very bad performance problem

On some circumstances, my app (an advanced text editor) is freezing during nearly 30s.
It appears that my text view's NSLayoutManager receives a lot (20!) of textStorage:edited:range:changeInLength:invalidatedRange: messages,
all having the same range arguments : newCharRange:{0, 32653}, invalidatedCharRange:{0, 32653}
where 32653 is exactly the length of the text.


Using gdb shows that my app freeze is caused by a "NSFontSetChangedNotification" being posted 20 times by CallatsDBHasChanged nearly every 1.5 second: see the gdb call stack

-[NSTextStorage _antialiasThresholdChanged:]
... notification posted
-[NSFontManager _loadFontFiles ]
fontCacheChanged
atsDBHasChanged
CallatsDBHasChanged
CFRunLoopRunSpecific
...
-[NSApplication run]


If I override

-(void)_antialiasThresholdChanged:(NSNotification *)notification;

to do nothing, no more freeze. But this is an awful hack!


The question : how come this NSFontSetChangedNotification being posted 20 times?
can I avoid that?
_______________________________________________


Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Re: How to ask for and utilize a user's password?
  • Next by Date: Check for screensaver
  • Previous by thread: Return code of process given ID
  • Next by thread: Check for screensaver
  • Index(es):
    • Date
    • Thread