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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:30:10+00:00 2026-05-26T03:30:10+00:00

I have been building a program for the past few months. I finally got

  • 0

I have been building a program for the past few months. I finally got to the point where everything was working great. The program has been built for iOS 5 from the beginning. And i just checked on things that i thought i had cemented in and that were working fine when i checked a few days ago. But now everything is acting goofy. My recorder stopped working. Not sure in what area. My seeker’s values arnt changing as they should. Playback of the recording is not working. The recorder used to take a second to load up where it would freeze the screen then start, now it is instantaneous which i find odd. Im sorry if im being vague but im totally stumped. The record button sets off a timer after the record command. In the timer there is an if statement, which has many clauses, one being myRecorder.isRecording == NO, and yet the if statement acts as if the conditions are met and executes the code inside, despite the recorder being told to record right before the timer even started. I AM BAFFLED. Please help. Thanks

Code for record button:
– (IBAction)record:(id)sender {
//[myPlayer play];

if ([sender tag] == 2){
    [self stop];
    [sender setTag:1];
    [sender setTitle:@"Record"];
    [sender setEnabled:NO];
    NSLog(@"Tag is 2");
}else{
    if ([myPlayer isPlaying]){
        [myPlayer pause];
        [myPlayer setCurrentTime:0];
    }
    anotherControl = 0; 
    theToolbar.userInteractionEnabled = NO;
    [theToolbar setTintColor:myColor];
    [theToolbar setAlpha:.5];
    [controlSong setTintColor:[UIColor blackColor]];
    beatPackTable.userInteractionEnabled = NO;
    beatPackTable.hidden = YES;
    onScreenTut.text = @"(Hold phone to your face and begin. When finished recording, hit the stop button)";
    recordCover.titleLabel.text = @"Recording";
    recordCover.titleLabel.textAlignment = UITextAlignmentCenter;
    recordCover.hidden = NO;
    NSString *docsDir;
    myDate = [[NSDate alloc] init];
    myDate = [NSDate date];
    seekerTwo.userInteractionEnabled = NO;
    homeButton.enabled = NO;
    tracksButton.enabled = NO;
    tutButton.enabled = NO;
    previewBeatTwo.enabled = NO;
    previewPauseTwo.enabled = NO;

    /*    
     NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
     [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
     [dateFormatter setDateStyle:NSDateFormatterShortStyle];
     NSString *myDate2 = [NSString stringWithFormat:@"%@",[dateFormatter stringFromDate:myDate]];
     */    
    //    dirPaths = NSSearchPathForDirectoriesInDomains(
    //                                                   NSDocumentDirectory, NSUserDomainMask, YES);
    docsDir = NSTemporaryDirectory();


    NSString *soundFilePath = [docsDir
                               stringByAppendingPathComponent:[NSString stringWithFormat:@"%@%i.caf",myDate,control]];

    NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];

    NSDictionary *recordSettings = [NSDictionary 
                                    dictionaryWithObjectsAndKeys:
                                    [NSNumber numberWithInt:AVAudioQualityLow],
                                    AVEncoderAudioQualityKey,
                                    [NSNumber numberWithInt:16], 
                                    AVEncoderBitRateKey,
                                    [NSNumber numberWithInt: 2], 
                                    AVNumberOfChannelsKey,
                                    [NSNumber numberWithFloat:44100.0], 
                                    AVSampleRateKey,
                                    nil];

    NSError *error = nil;



    myNewRecorder = [[AVAudioRecorder alloc]
                  initWithURL:soundFileURL
                  settings:recordSettings
                  error:&error];

    if (error)
    {
        NSLog(@"error: %@", [error localizedDescription]);

    } else {
        [myNewRecorder prepareToRecord];}




    seeker.userInteractionEnabled = NO;
    voiceVolumeControl.enabled =YES;
    recordButton.enabled = NO;

    stopButton.enabled = YES;


    myPlayer.currentTime = 0;
    [myNewRecorder record];
    [myPlayer play];
    [NSTimer scheduledTimerWithTimeInterval:1.0f
                                     target:self
                                   selector:@selector(updateCounter:)
                                   userInfo:nil
                                    repeats:YES];

if ([sender tag] == 1){
    [sender setTitle:@"End"];
    [sender setTag:2];

}}
NSLog(@"%@",myDate);
}

Code for timer:

-(void)updateCounter:(NSTimer *)theTimer{

    if ([myNewRecorder isRecording]) {
        [seeker setValue:myPlayer.currentTime/myPlayer.duration animated:YES];}

    if ([myPlayer2 isPlaying])
    {
        [seeker setValue:myPlayer2.currentTime/myPlayer2.duration animated:YES];
    }

    if ([myPlayer isPlaying] && myPlayer2.isPlaying == NO && myNewRecorder.isRecording == NO && isNotepadOpen == NO && anotherControl == 0) {
        [myPlayer stop];
        myPlayer.currentTime = 0;
        [seeker setValue:0];
        playButton.enabled = YES;
        stopButton.enabled = NO;
        NSLog(@"Its the timer for some reason");
    }

    if ([myNewRecorder isRecording] || [myPlayer isPlaying] || [myPlayer2 isPlaying]){
        [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
    }else{
        [[UIApplication sharedApplication] setIdleTimerDisabled:NO];
    }
    if ([myPlayer isPlaying]){
        [seekerTwo setValue:myPlayer.currentTime/myPlayer.duration animated:YES];
    }
}
  • 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-05-26T03:30:11+00:00Added an answer on May 26, 2026 at 3:30 am

    See my answer (and others) to that question on Programmers SE: “It was working yesterday, I swear!” What can you do?

    Basically, find what has changed since the sudden bugs, maybe a new delivery of iOS 5, Xcode or an external library that your software uses.

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

Sidebar

Related Questions

I'm working on building a tree structure in MySQL and have been experimenting with
I have been trying to set up OpenCV for the past few days with
I have only been working with C# for a few weeks and I have
I have a C++ code base that has been working for a long time.
I have been thinking about building a client to client program. But the way
For the past few months, we've been losing data to a Delayed Write errors.
I have been building a large python program for a while, and would like
For several months I've been working on a customer site building a web site
I have been building enterprise software for the last 10 years. In this time
I have been building IMO a really cool RIA. But its now close to

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.