ソースの表示以前のリビジョンバックリンク全て展開する/折り畳む文書の先頭へ Share via Share via... Twitter LinkedIn Facebook Pinterest Telegram WhatsApp Yammer Reddit Teams最近の変更Send via e-Mail印刷パーマリンク × « iPod nano発売! NSArrayとNSTableViewとNSArchiverを学ぶ » メソッドのポインタ Objective-Cのメソッドのポインタを取得して、メソッドをCの関数として呼び出す事が出来るのだとか。 // イニシャライズ id obj = [Hogehoge new] ; // メソッドのセレクタ取得 SEL method = @selector(methodOfHogehoge); // セレクタからメソッドのポインタ取得 IMP func = [Hogehoge instanceMethodFor:method];<br /> // 関数としてメソッド methodOfHogehoge を実行 func(obj, method); 肝となるのは、instanceMethodFor: メソッド。こいつがセレクタ(メソッドの内部識別子)から、メソッドのポインタを探し出してくれる。その返り値を、IMP型で受け取るとあら不思議、Cの関数呼び出しの形でObjective-Cのメソッドが実行できちゃった。ただし、引数として元のメソッドが含まれるオブジェクトのインスタンスと、メソッドのセレクタを渡してやらないといけない。 とりあえずObjective-Cの勉強は一段落したが、俯瞰してみるとObjective-Cが「Cの枠組みの中でオブジェクト指向を目指した言語」であるということがよくわかる。そのお陰かCの流れを汲んだオブジェクト指向言語であるC++と比べて、言語規模は格段に小さい(と思う)。 表記方法がかなり特殊ではあるが、初心者がオブジェクト指向を学ぶには、Objective-Cは結構いい言語なのでは?と思ったりした。 Comments Hello supporters of efficient cooling solutions ! The best air conditioner should integrate well with your heating system, especially in regions with changing seasons. Choosing a model that offers both heating and cooling features can provide year-round comfort. <a href=“https://best-air-conditioners.vercel.app/#” rel=“best-air-conditioners.vercel.app</a>. This versatility can save space and eliminate the need for multiple systems. Energy efficiency is a top priority for many homeowners, and best-air-conditioners.vercel.app can assist you in finding the most efficient options. Our thorough assessments highlight air conditioners that conserve energy while providing optimal cooling. Save on utility bills by using our resources to find the perfect fit. Best Air Conditioner Brands That Deliver on Quality Promises - http://best-air-conditioners.vercel.app/# May you enjoy incredible advanced cooling discoveries ! 1 | Williamcus | 2026-04-24 00:20 | reply Name E-Mail Website 人間の証明として、ボックス内の全ての文字を入力してください。 この項目は空のままにして下さい:Preview Comment blog/2005/2005-09-15.txt 最終更新: 2015-01-06 11:51(外部編集)