<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>anton0825</author_name>
  <author_url>https://blog.hatena.ne.jp/anton0825/</author_url>
  <blog_title>日々精進</blog_title>
  <blog_url>https://anton0825.hatenablog.com/</blog_url>
  <categories>
    <anon>IT</anon>
    <anon>iOS</anon>
  </categories>
  <description>init系メソッドの中では以下のようにnilチェックをするコードを書くことが多い。 - (id)init{ self = [super initWithNibName:nil bundle:nil]; if (self) { // 初期化 } return self; } なんでselfのnilチェックが必要なのかよくわかっていなかったので調べた。 ビルトインクラスの中には、正しく初期化できなかった時にinitメソッドがnilを返す仕様のものがあるらしい。 そういうクラスがあっても、例外を吐いて落ちないようにするためにnilチェックをするらしい。 であれば、initを呼び出す側のコードでもni…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fanton0825.hatenablog.com%2Fentry%2F20121015%2F1351756253&quot; title=&quot;initの中でselfのnilチェックをする理由 - 日々精進&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-10-15 16:50:53</published>
  <title>initの中でselfのnilチェックをする理由</title>
  <type>rich</type>
  <url>https://anton0825.hatenablog.com/entry/20121015/1351756253</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
