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 8164623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:21:33+00:00 2026-06-06T19:21:33+00:00

Question is in the title: Do I need to release SystemSoundID if I have

  • 0

Question is in the title: “Do I need to release SystemSoundID if I have ARC on?” Here is my Code:

NSURL *pathURL = [NSURL fileURLWithPath:path];
SystemSoundID soundid;
AudioServicesCreateSystemSoundID((__bridge_retained CFURLRef)pathURL, &soundid);
AudioServicesPlaySystemSound(soundid);

And if so, when do I release it? (I don’t have a dealloc method because I’m using a static method and that cannot be changed)

Also, is this currently the best way to play a sound effect I heard this framework is now deprecated.

THANKS!

  • 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-06T19:21:34+00:00Added an answer on June 6, 2026 at 7:21 pm

    Yes, you do need to release it. ARC only concerns itself with Obj-C objects, and a SystemSoundID is not an obj-c object. At some point you do need to call AudioServicesDisposeSystemSoundID() on your SystemSoundID value. You could do this with a system sound completion routine (using AudioServicesAddSystemSoundCompletion()).

    As for what sergio is talking about, you’re leaking the pathURL object. You’ve used __bridge_retained, which transfers ownership of the object to CoreFoundation. You should probably just change that to (__bridge CFURLRef)pathURL, which will not transfer ownership. The AudioServices API will retain the object as necessary.

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

Sidebar

Related Questions

The question from title doesn't need more details.
Apologies for the poor question title. I have two tables, jobs and Persons-Jobs. Jobs
Sorry for the bad question title. Let's say that I have DateRange class that
Question in title, but I'll elaborate. Say I have a form on a non-secure
I had a hard time phrasing my question's title. Basically here's the problem: I've
The question title just about says it all. I have a ASP.NET MVC 2
Hello everybody and sorry for the rather confusing question-title. I have a Hibernate Class
The question is simple. Do I need to release a NSLocalizedString? For instance: NSString
Again same question title but requirement is somewhat different. We have implemented push notification
Not sure it is clear from this question title what I mean, so here

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.