{"id":16642,"date":"2016-12-16T14:35:47","date_gmt":"2016-12-16T19:35:47","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=16642"},"modified":"2017-01-13T11:00:16","modified_gmt":"2017-01-13T16:00:16","slug":"touch-bar-crash-protection","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/12\/16\/touch-bar-crash-protection\/","title":{"rendered":"Touch Bar Crash Protection"},"content":{"rendered":"<p><a href=\"http:\/\/indiestack.com\/2016\/12\/touch-bar-crash-protection\/\">Daniel Jalkut<\/a>:<\/p>\n<blockquote cite=\"http:\/\/indiestack.com\/2016\/12\/touch-bar-crash-protection\/\">\n<p>I wrote previously about <a href=\"http:\/\/indiestack.com\/2016\/12\/touch-bar-crashers\/\">crashes related to Apple&rsquo;s Touch Bar<\/a>. These crashes seem to affect all apps that were built with a certain toolchain. Most likely it affects all apps that were built against an SDK of a certain vintage. For example, some of my apps that are still built against a 10.6 SDK crash on Touch Bar Macs, either frequently or infrequently, depending upon the user.<\/p>\n<p>I had hoped that we might see a fix from Apple in macOS 10.12.2, but alas the issue is still there.<\/p>\n<p>[&#8230;]<\/p>\n<p>Poking around the AppKit infrastructure supporting the Touch Bar, I discovered a secret NSUserDefaults setting, NSFunctionBarAPIEnabled, which seems to determine whether the system exposes an app to the Touch Bar at all. It defaults to YES, but if it&rsquo;s set to NO for an app, I think the app remains more or less invisible to the Touch Bar.<\/p>\n<\/blockquote>\n<p>Worth a try if, like me, you are getting crashes in <code>DFRFoundation<\/code>\/<code>DFRElement<\/code>\/<code>CALayer<\/code>.<\/p>\n<p>Update (2017-01-13): Instead of using <tt>NSFunctionBarAPIEnabled<\/tt>, you can set <tt>NSLayerPerformanceUpdates<\/tt> to <tt>YES<\/tt>. This works around the memory management bug that causes the crash without having to turn off the Touch Bar.<\/p>","protected":false},"excerpt":{"rendered":"<p>Daniel Jalkut: I wrote previously about crashes related to Apple&rsquo;s Touch Bar. These crashes seem to affect all apps that were built with a certain toolchain. Most likely it affects all apps that were built against an SDK of a certain vintage. For example, some of my apps that are still built against a 10.6 [&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":[2],"tags":[131,649,30,1381,1434],"class_list":["post-16642","post","type-post","status-publish","format-standard","hentry","category-technology","tag-bug","tag-esoteric-preferences","tag-mac","tag-macos-10-12","tag-touch-bar"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16642","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=16642"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16642\/revisions"}],"predecessor-version":[{"id":16927,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16642\/revisions\/16927"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=16642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=16642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=16642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}