views:

48

answers:

1

I tried to run this code on iPhone Simulator 4.0 and get that error

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


    }
//#endif

Does anyone have worked on the Multitasking with Simulator before ? Please help me.

Many Thanks

Tung Do

A: 

Are you compiling for the 4.0 SDK? Before the 4.0 SDK, the property multitaskingSupported is not defined, so the compiler will fail. Try

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

instead.

KennyTM
I found the problem. need to change Base SDK to iPhone 4.0 in Target properties instead of in Project properties.
Tùng Đỗ
That was the same thing.
ZaBlanc