Archive for the ‘xcode’ Category

 

objective-cでjsonを利用SBJson (aka json-framework)

6月 7th, 2012

http://stig.github.com/json-framework/api/3.0/index.html https://github.com/stig/json-framework/ 1. gitで取得 $ git clone https://github.com/stig/json-framework.git sbjson 2.classesの中のファイルをprojectに追加。 https://github.com/stig/json-framework/blob/master/INSTALL.md *.h *.m をすべてプロジェクトディレクトリにコピーして追加 3.利用するファイルにヘッダーを追加 #import “SBJson.h” コンパイルエラー SBJsonStreamParser.h:105: error: expected a property attribute before ‘unsafe_unretained’ こんな感じ http://stackoverflow.com/questions/7867983/cant-compiler-json-framework 意味が分からないのであまり良くないとは思うがデフォルト設定を変えてみるが、解決せず。 とりあえずxcodeのバージョンを最新にしてみるか 同様のエラーで、いくつか解決策のようなものもありましたが 結局。 SBJson関連ファイルがいくつか抜けていただけでした。 何も設定しなくても問題なく動きました。 os 1.7.4 xcode 4.3.2

Read full article | コメントは受け付けていません。

プロパティ、アクセサメソッド自動生成 | objective c

5月 26th, 2012

hello.h @property double nanswer; hello.m @synthesize nanswer; これで – (void) setNanswer: (double) nextAnswer { nanswer = nextAnswer; } – (double)nanswer { return nanswer; } を書かなくても自動生成してくれる。

Read full article | コメントは受け付けていません。

split view based application | objective-cで開発してみる xcode 4.3

5月 23rd, 2012

とりあえず、テストしたときのメモなどを書いておきます。 サンプルでとりあえず作ってみたらエラーが出た。 Split view based applicationを選んで、iPhoneで動かしてみたら program recieved signal SIGABRT *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘UISplitViewController is only supported when running under UIUserInterfaceIdiomPad’ そもそも split view based applicationは iPad 用というオチでした。

Read full article | コメントは受け付けていません。