(2009.1.28 新規作成) Objective-C は、ガベージコレクションがない時代のプログラミング言語です。プログラマがきちんとオブジェクトを解放するように書かなければなりません。 実装として、id 型は objc_objectへのポインタ型です。すべてのオブジェクトはmallocで確保されるイメージで、これはブロック内のローカル変数(のオブジェクト)を自動的に解放してくれるCより悪い状況です。 Objective-Cでは、自動解放プールと、ルールによるオブジェクトの解放で対処します。 gccにはライブラリが何も付いていないので、以降はGNUstepを前提とします。Fedora 10 Linux + gcc 4.3 で確認しました。 NSAutoreleasePool オブジェクトを生成したら自動解放プールに登録するようにします。自動解放プールが解放されるときに登録されたオブジェ
Join Date Apr 2007 Location (X,Y,Z) = (0,0,0) Beans 3,715 Hi there! I'm here looking a bit into Objective-C and I'm impressed. It's a really nice language (just "C with Classes" not C++ bloat) but I won't go into that here. But I had real troubles to get the sources compiled with gcc under Debian (so Ubuntu is surely the same) and after a lot of research, I could. Here's a little how-to for anyone
Ubuntu Linux 8.04でObjective-Cのプログラミングが出来るようにする方法。 1. build-essentialのインストール Ubuntu 8.04はデフォルトでgccはインストールされているものの、libc6-devが入っていないため、build-essentialをインストールする。 sudo apt-get install build-essential 2. Objective-C用のライブラリをインストール sudo apt-get install gobjc 以上でObjective-Cのプログラミングが出来るようになる。 【追記】 上記だけでは、例えばNSObjectクラスを利用するために、ヘッダファイルFoundation/NSObject.hをimportしてコンパイルすると"error: Foundation/NSObject.h: No su
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く