Software Development on Apple

iPhoneやMacで楽しもう!

Archive for 2009年4月

Cocoaのあるクラスの使用例に対するAppleのサンプル・ソースを簡単に探す一つの方法

Posted by seachicken : 4月 10, 2009

先ずは、該当するCocoaクラスのリファレンスドキュメントをWebなどで検索します。そのドキュメントをよく見ると「Related sample code」という項目があります。この項目はドキュメントの先頭にも、そして各メソッドの説明の中でも登場します。つまり、そのクラス、そのメソッドが使われているAppleのサンプル・ソースがそこには書かれています。後は簡単、ADCでその名前で検索し、サンプル・ソースを取得すればいいです。

Posted in Cocoa, Memo, Tips | Leave a Comment »

static in C language

Posted by seachicken : 4月 10, 2009

下記はCのstaticの使用についてのメモ。

static functions are functions that are only visable to other functions in the same file. (Like private of Java)

For some reason, static has different meanings in in different contexts.

1. When specified on a function declaration, it makes the function local to the file.

2. When specified with a variable inside a function, it allows the vairable to retain its value between calls to the function.

Posted in C | タグ: | Leave a Comment »