{"id":8315,"date":"2014-01-16T16:54:54","date_gmt":"2014-01-16T21:54:54","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8315"},"modified":"2014-01-16T16:56:28","modified_gmt":"2014-01-16T21:56:28","slug":"associated-objects-on-value-types","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/01\/16\/associated-objects-on-value-types\/","title":{"rendered":"Associated Objects on Value Types"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/gparker\/status\/422821894564237312\">Greg Parker<\/a> notes that one should not use <code>objc_setAssociatedObject()<\/code> to attach associated objects to immutable value-like types such as <code>NSNumber<\/code>, <code>NSDate<\/code>, and <code>NSString<\/code>. The reason is that, due to de-duplication and tagged pointers, the objects may be shared and\/or immortal.<\/p>","protected":false},"excerpt":{"rendered":"<p>Greg Parker notes that one should not use objc_setAssociatedObject() to attach associated objects to immutable value-like types such as NSNumber, NSDate, and NSString. The reason is that, due to de-duplication and tagged pointers, the objects may be shared and\/or immortal.<\/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,30,54,71],"class_list":["post-8315","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-mac","tag-objective-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8315","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=8315"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8315\/revisions"}],"predecessor-version":[{"id":8316,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8315\/revisions\/8316"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}