Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8805457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:52:19+00:00 2026-06-14T01:52:19+00:00

Started a Cocos2D 2.1 template (with no physics engine) in Xcode 4.5, targeted for

  • 0

Started a Cocos2D 2.1 template (with no physics engine) in Xcode 4.5, targeted for iOS 6 and iPad. In the CDAudioManager.m file, the following code…

AVAudioSession* session = [AVAudioSession sharedInstance];
session.delegate = self;  // Which is what is automatically generated by the template.

…generates the following warning…

"delegate deprecated:  first deprecated in iOS 6"

So I go to the apple developer documentation, and it says under “delegate,” “Deprecated in iOS 6.0. Use the notifications described in the Notifications section of this class instead.”

http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSession_ClassReference/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instp/AVAudioSession/delegate

Problem is, it looks to me like all we’re trying to do–forgive my inexperience–is set the delegate for the AVAudioSession to the CDAudioManager instance itself. How do the notifications accomplish this? Or am I just wrong about the goal of the above code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:52:21+00:00Added an answer on June 14, 2026 at 1:52 am

    The error you are running into is in this block of code

    AVAudioSession* session = [AVAudioSession sharedInstance];
    session.delegate = self;// <-------- DEPRECATED IN IOS 6.0
    

    To silence the warning change those 2 lines to this:

    [[AVAudioSession sharedInstance] setActive:YES error:nil];
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i started out learning cocos2d and came across these lines of code: -(id)init {
I'm creating a cocos2d game on iOS that uses the accelerometer. I just started
Started making a game. Here's some of my code. package games.tribe.screens; import games.tribe.model.World; import
I started getting the following error whenever i use SVN in my server: svn:
I have started working on a new Xcode project, a game to be exact.
So I'm trying to draw a simple rectangle in my iOS cocos2d game, but
So using Cocos2D-X, in the AppDelegate.cpp file, I uncomment the line: SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); so that
I'm trying to get started with cocos2d by creating an app with a background
I found a fix to support iPad retina display for my cocos2d game. It
I've started working with cocos2d few days ago...and im working on small 2d game.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.