{"id":6589,"date":"2012-11-30T14:36:08","date_gmt":"2012-11-30T19:36:08","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=6589"},"modified":"2014-06-28T09:45:34","modified_gmt":"2014-06-28T13:45:34","slug":"an-objective-c-literal-subtlety","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/11\/30\/an-objective-c-literal-subtlety\/","title":{"rendered":"An Objective-C Literal Subtlety"},"content":{"rendered":"<p><a href=\"http:\/\/blog.bignerdranch.com\/1226-an-objective-c-literal-subtlety\/\">Adam Preble<\/a>:<\/p>\r\n<blockquote cite=\"http:\/\/blog.bignerdranch.com\/1226-an-objective-c-literal-subtlety\/\"><p>I would argue that this method should use <code>-boolValue<\/code> to check the options dictionary values, but I would also argue that this is something the compiler should be handling when it translates the literal syntax into an object. I&rsquo;ve filed radars on both of these issues this with Apple (<a href=\"http:\/\/www.openradar.me\/radar?id=2344401\">rdar:\/\/12761147<\/a> and <a href=\"http:\/\/www.openradar.me\/radar?id=2343401\">rdar:\/\/12761621<\/a>).<\/p><\/blockquote>\r\n<p>He found that GLKit checks the identity of <code>NSNumber<\/code> objects rather than their value and that <code>@(YES)<\/code> doesn&rsquo;t have class <code>__NSCFBoolean<\/code>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Adam Preble: I would argue that this method should use -boolValue to check the options dictionary values, but I would also argue that this is something the compiler should be handling when it translates the literal syntax into an object. I&rsquo;ve filed radars on both of these issues this with Apple (rdar:\/\/12761147 and rdar:\/\/12761621). He [&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":[131,69,54,71],"class_list":["post-6589","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bug","tag-cocoa","tag-objective-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/6589","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=6589"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/6589\/revisions"}],"predecessor-version":[{"id":9060,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/6589\/revisions\/9060"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=6589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=6589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=6589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}