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

  • SEARCH
  • Home
  • 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 8501451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:13:00+00:00 2026-06-11T01:13:00+00:00

For some reason, which I’m not sure why, my app keeps crashing on the

  • 0

For some reason, which I’m not sure why, my app keeps crashing on the fadeTo method on a OALAudioTrack object.

I have three different OALAudioTrack objects which are within an array and I only need to change a OALAudioTrack object if a given value is different. When the value is different I need to fade a OALAudioTrack object out and then fade the new OALAudioTrack object in and replace the OALAudioTrack object in the array but I can’t do this as it keeps crashing when doing the first fade out (to 0.0f). When the app crashes it always crashing on the same line, which is within OALActionManager.m line #159 ( NSUInteger index = [targets indexOfObject:action.target]; ) and the error says “Thread 1 EXE_BAD_ACCESS”. Is there something I must do before doing the fades, any help would be much appreciated as I’ve been looking at it for over a day and I can’t seem to get past this error. The code I am using is below:

if ([[self.soundScapes objectAtIndex:i] isKindOfClass:[OALAudioTrack class]])
{
    [self.tmpSoundScapes removeAllObjects];
    [self.tmpSoundScapes addObject:[fnArr objectAtIndex:i]];
    [self.tmpSoundScapes addObject:[NSNumber numberWithInt:i]];

    OALAudioTrack *currentTrack = [self.soundScapes objectAtIndex:i];

    if ([currentTrack playing])
    {
      NSLog(@"is playing");
      [currentTrack stopFade];

      //This is where the app crashes
      [currentTrack fadeTo:0.0 duration:1.5 target:self selector:@selector(onFadeComplete:)];
    }
}




-(void)onFadeComplete:(id)sender
{
    NSLog(@"fade complete");

    NSString *fn = [self.tmpSoundScapes objectAtIndex:0];
    int i = [[self.tmpSoundScapes objectAtIndex:1] intValue];

    OALAudioTrack *currentTrack = [self.soundScapes objectAtIndex:i];
    [currentTrack stop];
    currentTrack = nil;

    OALAudioTrack* track = [OALAudioTrack track];
    [track preloadFile:fn];
    track.autoPreload = YES;
    track.numberOfLoops = -1;   // Loop forever when playing.            
    track.gain = 0.0f; // volume
    [track play];

    [self.soundScapes replaceObjectAtIndex:i withObject:track];
    [self.soundScapesFiles replaceObjectAtIndex:i withObject:fn];

    int timer;
    if (i==1) 
        timer = 10.0f;
    else if (i==2)
        timer = 25.0f;
    else
        timer = 0.5f;

//    [self performSelector:@selector(onPlayScoundScape:) withObject:[NSNumber numberWithInt:i] afterDelay:timer];
    [track fadeTo:1.0f duration:timer target:self selector:@selector(onPlayScoundScape:)];
}
  • 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-11T01:13:01+00:00Added an answer on June 11, 2026 at 1:13 am

    The part that’s crashing is “action.target”. “target” is a weak reference, so if your track deallocates before the action finishes, it will crash.

    I suspect that at some point your code is either removing the track from self.soundScapes in some other method, or another call to onFadeComplete is being made, generating the same index (thus evicting the currently fading track), before the track fade completes.

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

Sidebar

Related Questions

I have this code http://jsfiddle.net/xNHKP/6/ (not working in the fiddle for some reason which
In my jquery i have the following code, which for some reason is not
I have the following code, which does not work correctly for some reason that
I have an RSS feed which for some reason is not showing my PHP
I have some tables for which I have no reason to ever update from
For some reason I have a file error.log which is 16GB In my Repositories
I have a web-application which uses hibernate and for some reason every thread (httprequest
I have a LINQ query, which for some reason is generating an extra/duplicate INNER
I have the following code which was working but now for some reason does
I have some javascript which parses an ISO-8601 date. For some reason, it is

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.