• 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
Re: using AppKit additions in background threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using AppKit additions in background threads


  • Subject: Re: using AppKit additions in background threads
  • From: Michael Thon <email@hidden>
  • Date: Tue, 06 Sep 2011 20:11:01 +0200

On Sep 6, 2011, at 6:23 PM, Douglas Davidson wrote:

>
> On Sep 6, 2011, at 9:20 AM, Michael Thon wrote:
>
>> I'm importing data to an NSAttributedString using the method: initWithData:options:documentAttributes:error: which is an AppKit addition to NSAttributedString.  I'm doing this in an NSOperation running on a separate thread, and what I see is that the UI of the app becomes unresponsive while this method is called.  It doesn't happen all the time, but presumably the hang is related to the size of the data being converted.
>
> What kind of documents are you importing?  If this involves HTML, then it will use WebKit to do part of the work, and WebKit runs exclusively on the main thread.  The AppKit methods can be invoked on arbitrary threads, but they will transfer WebKit work to the main thread as needed.
>
> Douglas Davidson
>

Yup, they're HTML, all right. Now I'm thinking of moving this code to a separate command line app that I can call from the main application. It should work, but I'm not sure if I'd need to provide a runloop for the HTML importing to work.  Well, easy enough to try.  If not, I'll have to find some other method for importing the HTML._______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: using AppKit additions in background threads
      • From: Jens Alfke <email@hidden>
References: 
 >using AppKit additions in background threads (From: Michael Thon <email@hidden>)
 >Re: using AppKit additions in background threads (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?
  • Next by Date: Re: Getting notification about new font is available
  • Previous by thread: Re: using AppKit additions in background threads
  • Next by thread: Re: using AppKit additions in background threads
  • Index(es):
    • Date
    • Thread