Search code examples
iphoneobjective-cios-simulatorfbconnectuidevice

Warning: 'UIDevice' may not respond to '-isMultitaskingSupported'



I am working with new FBConnect for iPhone. But I have followed the steps given.. but when i build it shows me this warning "Warning: 'UIDevice' may not respond to '-isMultitaskingSupported'" and the app crashes. I am using iphone simulator 4.1 and still it is showing me this warning. If anyone can help me out with this it will be great.

Thanks in advance.


Solution

  • Versions of iOS prior to 4.0 don't have this method, so you have to use respondsToSelector to first check that the method is present prior to calling it.

    if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)] && [[UIDevice currentDevice] isMultitaskingSupported]) {
        // Device supports multi-tasking...
    
    }
    else {
        // No such luck.
    }
    

    As such, whilst you're using the iPhone simulator 4.1, I'm guessing that you've set the iOS version to 3.2 (use the Version option on the Hardware menu to change this).