4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Headerdocでソースコードを記述する

Last updated at Posted at 2015-05-18

HeaderDocを使ってコメント内にソースコード片を記述する方法がAppleのドキュメントには載っていなかったので、メモとして残しておきます。

コメント内にコードを記述するには、@code@endcodeとを使います。

/**
 コード片をコメントに書くには\@codeと\@endcodeで区切って記述します。

 @code
 BOOL result = [myObject foo];
 @endcode
 */
- (BOOL)foo;
 :

この2つに囲まれた範囲がソースコードとして認識され、バルーンヘルプにもそれらしく表示されるようになります。

バルーンヘルプにも分かりやすく表示される

参考サイト

stackoverflowの以下の記事が参考になります。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?