0

このコードをiPhoneSimulator4.0で実行しようとすると、エラーが発生します

//#ifdef __IPHONE_4_0
    UIDevice *device = [UIDevice currentDevice];
    if ([device respondsToSelector:@selector(isMultitaskingSupported)] && device.multitaskingSupported)
    {


    }
//#endif

誰かが以前にシミュレータでマルチタスクに取り組んだことがありますか?私を助けてください。

どうもありがとう

Tung Do

4

1 に答える 1

1

4.0 SDK用にコンパイルしていますか?4.0 SDKより前では、プロパティmultitaskingSupportedが定義されていないため、コンパイラは失敗します。試す

if ([device respondsToSelector:@selector(isMultitaskingSupported)] &&
    [device isMultitaskingSupported]) {
      ...
}

代わりは。

于 2010-06-23T12:06:15.997 に答える