{"id":8559,"date":"2014-03-13T10:45:17","date_gmt":"2014-03-13T14:45:17","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8559"},"modified":"2017-08-01T14:49:44","modified_gmt":"2017-08-01T18:49:44","slug":"nsprogress","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/03\/13\/nsprogress\/","title":{"rendered":"NSProgress"},"content":{"rendered":"<p><a href=\"http:\/\/oleb.net\/blog\/2014\/03\/nsprogress\/\">Ole Begemann<\/a>:<\/p>\n<blockquote cite=\"http:\/\/oleb.net\/blog\/2014\/03\/nsprogress\/\"><p>Because the current progress is thread-specific, it is important that the worker object creates its progress object on the same thread it was invoked on. Otherwise, the parent-child relationship will not be set up correctly. Once created, <code>NSProgress<\/code> objects are thread-safe. The worker object can later update properties on the progress from any thread\/queue.<\/p><\/blockquote>\n<p>The view controller observes the progress using KVO, but the observer method is called on the worker&rsquo;s thread\/queue, so it has to tell the main thread to update the user interface. It seems like this could perhaps be simpler, but overall it looks like <code>NSProgress<\/code> has a pretty clean API. It&rsquo;s definitely one of the more interesting new Cocoa features.<\/p>","protected":false},"excerpt":{"rendered":"<p>Ole Begemann: Because the current progress is thread-specific, it is important that the worker object creates its progress object on the same thread it was invoked on. Otherwise, the parent-child relationship will not be set up correctly. Once created, NSProgress objects are thread-safe. The worker object can later update properties on the progress from any [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,469,275,475,1549,71],"class_list":["post-8559","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios7","tag-keyvalueobserving","tag-mavericks","tag-nsprogress","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8559","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=8559"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8559\/revisions"}],"predecessor-version":[{"id":18516,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8559\/revisions\/18516"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}