{"id":154,"date":"2003-01-02T15:40:40","date_gmt":"2003-01-02T20:40:40","guid":{"rendered":"\/?p=154"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"pointers_in_cocoa","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2003\/01\/02\/pointers_in_cocoa\/","title":{"rendered":"Pointers in Cocoa"},"content":{"rendered":"I don&rsquo;t quite understand <a href=\"http:\/\/radio.weblogs.com\/0108956\/2002\/12\/28.html#a87\">what Victor Ng is on about<\/a>. Objective-C ivar pointers <em>are<\/em> initialized to <code>nil<\/code>, and you should get a compiler warning if you attempt to use an uninitialized local variable. But he&rsquo;s right, of course, that it&rsquo;s easy to send a message to a released object. Unlike Victor, I <em>don&rsquo;t<\/em> set pointers to released objects to <code>nil<\/code> because I think that would make it harder to detect errors; Objective-C will happily send any message to <code>nil<\/code> without complaining. I&rsquo;d rather use NSZombieEnabled during testing.","protected":false},"excerpt":{"rendered":"<p>I don&rsquo;t quite understand what Victor Ng is on about. Objective-C ivar pointers are initialized to nil, and you should get a compiler warning if you attempt to use an uninitialized local variable. But he&rsquo;s right, of course, that it&rsquo;s easy to send a message to a released object. Unlike Victor, I don&rsquo;t set pointers [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","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":[],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/154","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}