2010年7月19日月曜日

UIApplicationMainは戻らない

iPhoneアプリを触ってみた。

Interface Builderが作ったサンプルで
UIApplicationMain()が戻りを返さない。

[サンプル]
int main(int argc, char *argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;
}

どっかで落ちてるのかと思って調べてみた。
結論だけ残すとこうなった。

UIKit Function Reference
UIApplicationMain
Return Value
Even though an integer return type is specified, this function never returns.
When users terminate an iPhone application by pressing the Home button,
the application immediately exits by calling the exit system function with
an argument of zero.

[和訳]
この関数は戻り値を返さない。
HOMEボタンとか押されて※終了すべきときはexit(0)で終わる。
..orz
※iPhone4の場合、HOMEボタンでは終了しない。

歌集めてみた

hana/Usa (花/うさ) - Lorelei (ローレライ)


初音ミク メルトPV うさ Ver


ぱんだのこども 歌ってみた 【リツカ】


【Just a game】歌ってみたver.祭屋(45秒以降を聞こう)

WEBマンガ見てきた

隙間のない引き出し