Cocoa開発においてインスタンス変数名はアンダースコアから始まっても良いのか
そうだったのか.. "Noted that "_" is a suitable prefix for ivar names." http://t.co/Olsom8FB
2012-02-18 17:25:50@noborunrun @griffin_stewie 改変前のドキュメントと見比べないといけませんね。元々ivarについては言及がなかったか、Appleの気が変わったかのどちらか
2012-02-19 13:12:03@nakiwo 一つ前のリビジョンではivarの命名について言及が無かった。元々どこに書いてあったんだろう...思い込んでただけかな。まぁ、使って言いって明示してあるんだから使っちゃおう
2012-02-19 13:23:10@nakiwo 最終更新日が2012年1月9日の文書でも「By convention, you prefix the instance variable name with an underscore...」という文章が見つかるので2月16日に方向転換という訳ではなさそうですね。
2012-02-19 14:25:24※Cocoa Coding Guidelinesの2004-07-23版
“Do not use the underscore character as a prefix meaning that the instance variable is private. Apple reserves the use of this convention because its use by third parties could result in name-space collisions.”
@nakiwo おお、本当ですね! 以前はインスタンス変数もプライベート・メソッドもアンダースコア禁止が明示されていたんですね。それが現在はプライベート・メソッドのみ禁止に緩和されたと。ありがとうございます、スッキリしました ><
2012-02-23 15:51:50