开发者

Value of UIBackgroundTaskInvalid is?

开发者 https://www.devze.com 2023-02-01 05:49 出处:网络
I read from the header file (UIApplication.h): typedef NSUInteger UIBackgroundTaskIdentifier; UIKIT_EXTERN const UIBackgroundTaskIdentifier UIBackgroundTaskInvalid__OSX_AVAILABLE_STARTING(__MAC_NA,__

I read from the header file (UIApplication.h):

typedef NSUInteger UIBackgroundTaskIdentifier;
UIKIT_EXTERN const UIBackgroundTaskIdentifier UIBackgroundTaskInvalid  __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);

It seems that UIBackgrou开发者_运维知识库ndTaskInvalid is just an ordinary NSUInteger with a given value. Now that I'm writing code that has to be compatible with jailbreaking iOS 3.1.3 (where UIBackgroundTaskInvalid is not defined yet). I might need the real value behind it. Anyone can help?

Thanks in advance.

Di


You can check it with

#if !defined UIBackgroundTaskIdentifier
   // Pre iOS 4 Fallback
#endif

The sample above only checks the value on compile time. If you need these kind of checks on run-time you can check this great article.

0

精彩评论

暂无评论...
验证码 换一张
取 消