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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:33:43+00:00 2026-06-10T08:33:43+00:00

I have two problems. 1- I am using following code to add background music

  • 0

I have two problems.

1- I am using following code to add background music in my iphone app.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        // Override point for customization after application launch.
        sleep(5);
         //this variable can be named differently

        NSString *path = [[NSBundle mainBundle] pathForResource:@"%@/background_music" ofType:@"wav"];


    // the file is stored in MyApp/SharedResources folder where as delegate is placed at MyApp/        
            backgroundSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] 

error:nil];

        backgroundSound.delegate = self;

        [backgroundSound prepareToPlay];

        [backgroundSound play];

        backgroundSound.numberOfLoops = -1;


        return YES;
    }

    @interface AppDelegate : UIResponder <UIApplicationDelegate>{
        AVAudioPlayer *backgroundSound;

    }

By running this code i am getting build failed.Undefined symbols for architecture i386:

"_OBJC_CLASS_$_AVAudioPlayer", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My second problem..

Suppose I have to turn this music off in another viewController with a button. How can I do that. E.G SettingsViewController.

* thread #1: tid = 0x2c03, 0x90870c5a libSystem.dylib`__kill + 10, stop reason = signal SIGABRT
    frame #0: 0x90870c5a libSystem.dylib`__kill + 10
    frame #1: 0x90870c4c libSystem.dylib`kill$UNIX2003 + 32
    frame #2: 0x909035a5 libSystem.dylib`raise + 26
    frame #3: 0x909196e4 libSystem.dylib`abort + 93
    frame #4: 0x90895b1b libSystem.dylib`_Unwind_Resume + 59
    frame #5: 0x016c8e39 CoreFoundation`CFRunLoopRunSpecific + 345
    frame #6: 0x016c8ccb CoreFoundation`CFRunLoopRunInMode + 123
    frame #7: 0x0019e2a7 UIKit`-[UIApplication _run] + 576
    frame #8: 0x0019fa9b UIKit`UIApplicationMain + 1175
    frame #9: 0x00002a62 myApp`main + 130 at main.m:16
    frame #10: 0x000029d5 myApp`start + 53

Best Regards

  • 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-10T08:33:44+00:00Added an answer on June 10, 2026 at 8:33 am

    This is a linker error, you have to link against the AVFoundation framework.

    To stop the playback from another class/instance/wherever you want, you can have multiple solutions:

    One. Declare a property on the class you want to stop the playback from, and set that property to the original view controller. Then access that view controller using the property and call a method on it to stop the music.

    Two. In some central class, such as your app delegate or main view controller, add an NSNotificationCenter-observer and simply use notifications throughout your app without messing with properties.

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

Sidebar

Related Questions

I'm using devexpress and i have two problems. My insert stored procedure work fine.
In my code I have the two following collections: private ObservableCollection<Job> listOfJobs1 = new
I have two problems: I am creating a WebControl and I like to add
I am writing an application using WPF, MVVM, and PRISM regions. I have two
I got a probably small problem using memcmp. I have two arrays (length =
I have an strange problem using two borders. I use them to display video
I have two pairs of drag/drop/sortable lists using JqueryUI.http://jqueryui.com/demos/sortable/ My problem is that I
I am using DllImport in my solution. My problem is that I have two
I have my program that can draw rectangles. I have two problems I can't
I have two cmake-related problems: first, I can't make it to find the includes

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.