i m making audio play background application error in following code in this code bgtask is undeclared i do not find bgtask is which kind of object
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UIApplication *app = [UIApplication sharedApplication];
bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
[app endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
}];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{});
[app endBackgroundTask:bgTask]; bgTask = UIBackgroundTaskInvalid;
}