記事一覧

How to import ObjCOSC to project

ObjCOSC comes with .framework file but it doesn't work maybe because the version of SDK doesn't match.
But you can use ObjCOSC by manually importing the sources to your new project. Below is how to do that.

1. Make your new project as usual.

2. Add all ObjCOSC source files to your project. The files are:
* OSCInPort.h
* OSCInPort.m
* OSCPort.h
* OSCPort.m
* All files under OSC-Kit-Mac/

3. Delete or comment out
#import <Cocoa/Cocoa.h>
at line #9 of OSCInPort.h :

4. At line #492 in OSC-address-space.c insert a dummy code (like "1;") to avoid "Label at end of compound statement" error.

5. Add #import "OSCPort.h" and #import "OSCInPort.h"
to your codes where you need it.


ObjCOSCには一応 .framework ファイルが付いてくるので本来はそれをインストールすれば良いはずなんですが、おそらくSDKのバージョン違いか何かで動きません。
が、ソースをプロジェクトに入れ込んでコンパイルしてしまえば大丈夫です。以下その方法。

1. 普通のiPhoneアプリのテンプレートでプロジェクト作成

2. ObjCOSCのソースを全部プロジェクトに追加。内訳は:
*OSCInPort.h
*OSCInPort.m
*OSCPort.h
*OSCPort.m
*OSC-Kit-Mac/ 以下全部
※「デスティネーションにコピー」を忘れずに。

3. OSCInPort.h 9行目の
#import <Cocoa/Cocoa.h>を削除またはコメントアウト

4. OSC-address-space.c の 492行目に何かダミーコード("1;" とか)を入れる。これを入れないと "Label at end of compound statement" エラーになる(少なくともウチのコンパイラ設定では)

5. 必要なところに
#import "OSCPort.h"
#import "OSCInPort.h"
を入れる。