beginBackgroundTaskWithExpirationHandler

后端 未结 3 1022
青春惊慌失措
青春惊慌失措 2020-12-15 08:00

I am making an application where audio will play in the background. In the following code, bgTask is undeclared. What kind of object should bgTask be?

- (voi         


        
3条回答
  •  伪装坚强ぢ
    2020-12-15 08:57

    I cannot comment on previous answers, however to initialize UIBackgroundTaskIdentifier you should not set it to nil or 0. You should set it to:

    UIBackgroundTaskInvalid
    

    In the documentation UIBackgroundTaskInvalid says it should be used to initialize variables or to check for errors.

提交回复
热议问题