title: how to call the function to display the data in objective-c
body: <p>I am creating the app for kids.I am new to this field.</p>
  
  <p>The below code is for speech:</p>
  
  <pre><code>-(void)textToSpeechAction:(NSMutableArray *)imageStoreArray :(int)counter :(UIImageView *)imageChangeImageView :(UIImageView *)spekerOrMic :(BOOL)isMicPresent
  {
      spekerOrMic.image = [UIImage imageNamed:@"speaker.png"];
      NSArray *items = [[imageStoreArray objectAtIndex:counter] componentsSeparatedByString:@"."];
      NSString *speechString;
      if(_isWritePresent)
      {
          NSArray *viewToRemove = [spekerOrMic subviews];
          for (UIImageView *v in viewToRemove) {
              [v removeFromSuperview];
          }
          spekerOrMic.image = [UIImage imageNamed:@""];
          spekerOrMic.backgroundColor = [UIColor colorWithRed:41/255.0 green:52/255.0 blue:44/255.0 alpha:1.0];
          NSString *tempString = [items objectAtIndex:0];
          NSArray *tempArray = [tempString componentsSeparatedByString:@" "];
          speechString = [tempArray objectAtIndex:1];
      }
      else
      {
          speechString = [items objectAtIndex:0];
      }
  
      AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init];
  
      AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:speechString];
      [utterance setRate:0.2f];
      utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
      [synthesizer speakUtterance:utterance];
  
      imageChangeImageView.image = [UIImage imageNamed:[imageStoreArray objectAtIndex:counter]];
  
      if(isMicPresent)
      {
          [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(micAction:) userInfo:spekerOrMic repeats:NO];
      }
  }
  
  -(void)micAction:(NSTimer *)timer
  {
      NSLog(@"mic action");
      UIImageView *micOrSpeaker = timer.userInfo ;
      micOrSpeaker.image = [UIImage imageNamed:@"mic.png"];
      // Set the audio file
      NSArray *pathComponents = [NSArray arrayWithObjects:
                                 [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject],
                                 @"MyAudioMemo.m4a",
                                 nil];
      NSURL *outputFileURL = [NSURL fileURLWithPathComponents:pathComponents];
  
      // Setup audio session
      AVAudioSession *session = [AVAudioSession sharedInstance];
      [session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
  
      // Define the recorder setting
      NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init];
  
      [recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
      [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
      [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey];
  
      // Initiate and prepare the recorder
      recorder = [[AVAudioRecorder alloc] initWithURL:outputFileURL settings:recordSetting error:NULL];
      recorder.delegate = self;
      recorder.meteringEnabled = YES;
      [recorder prepareToRecord];
  
      [recorder record];
  
      [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(recordStopAction:) userInfo:micOrSpeaker repeats:NO];
  }
  
  -(void)recordStopAction:(NSTimer *)timer
  {
      NSLog(@"stop");
      [recorder stop];
      UIImageView *micOrSpeaker = timer.userInfo;
      micOrSpeaker.image = [UIImage imageNamed:@""];
  
      _isRecordComplete = YES;
  
      AVAudioSession *audioSession = [AVAudioSession sharedInstance];
      [audioSession setActive:NO error:nil];
  }
  
  -(void)recordPlayAction
  {
      if (!recorder.recording){
          _player = [[AVAudioPlayer alloc] initWithContentsOfURL:recorder.url error:nil];
          [_player setDelegate:self];
          [_player play];
      }
  }
  </code></pre>
  
  <p>alphabet phonics code:</p>
  
  <pre><code>    NSMutableArray *arrForA = [[NSMutableArray alloc] initWithObjects:@"apple.png", @"ant.png", nil];
      NSMutableArray *arrForB = [[NSMutableArray alloc] initWithObjects:@"bee.png", @"bear.png", nil];
  
  
      dictAlpha = [[NSMutableDictionary alloc] initWithObjectsAndKeys: arrForA, @"a.png", arrForB,@"b.png", nil];
  
  
  
  
  
      NSLog(@"%@",dictAlpha); // 1
  
  
  
      commonFunctionObject = [[SpeechCommonFunctions alloc]init];
      commonFunctionObject.isRecordComplete = NO;
      counter = 0;
      isMicPresent = YES;
      _confirmationPopupView.hidden = true;
      [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(repeatActionFire) userInfo:nil repeats:NO];
  
  }
  
  -(void)repeatActionFire
  {
  
  
      keys=[dictAlpha allKeys];
  
      if(counter&gt;=keys.count)
      {
          NSLog(@"finished");
          [_alphabetsShowImageView removeFromSuperview];
          [_speakerOrMicImageView removeFromSuperview];
          [_images removeFromSuperview];
          UIImageView *congratzView = [[UIImageView alloc]initWithFrame:self.view.frame];
          congratzView.image = [UIImage imageNamed:@"congratulation.png"];
          [self.view addSubview:congratzView];
  
      }
      else{
  
  
          [commonFunctionObject textToSpeechAction:keys :counter :_alphabetsShowImageView:_speakerOrMicImageView :isMicPresent];
          [NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(ActionToCkeckRecordCompletion) userInfo:nil repeats:NO];
  
             }
  }
  
  -(void)pik{
        arrVal = [dictAlpha objectForKey:keys[i]];
  
  
        if(j&lt;arrVal.count){
  
              [commonFunctionObject textToSpeechAction:arrVal :j :_images :_speakerOrMicImageView :isMicPresent];
              [NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(ActionToCkeckRecordCompletion1) userInfo:nil repeats:NO];
  
  
        }
      else
      {
         // [arrVal removeAllObjects];
          [_images removeFromSuperview];
          counter+=1;
                 [self repeatActionFire];
      }
  
  }
  -(void)ActionToCkeckRecordCompletion1
  {
      if(commonFunctionObject.isRecordComplete)
      {
          _confirmationPopupView.hidden = false;
      }
      [self pik];
  
  
  }
  
  
  -(void)ActionToCkeckRecordCompletion
  {
      if(commonFunctionObject.isRecordComplete)
      {
          _confirmationPopupView.hidden = false;
      }
      [self pik];
  
  }
  
  - (void)didReceiveMemoryWarning {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  /*
   #pragma mark - Navigation
  
   // In a storyboard-based application, you will often want to do a little preparation before navigation
   - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
   // Get the new view controller using [segue destinationViewController].
   // Pass the selected object to the new view controller.
   }
   */
  
  - (IBAction)playButtonAction:(id)sender
  {
      [commonFunctionObject recordPlayAction];
  }
  
  - (IBAction)nextButtonAction:(id)sender
  {
      j+=1;
      [self pik];
  
      _confirmationPopupView.hidden = true;
      commonFunctionObject.isRecordComplete = NO;
      if(commonFunctionObject.player.playing){[commonFunctionObject.player stop];}
      [self repeatActionFire];
  }
  
  - (IBAction)retryButtonAction:(id)sender
  {
  
  
      _confirmationPopupView.hidden = true;
      commonFunctionObject.isRecordComplete = NO;
      if(commonFunctionObject.player.playing){[commonFunctionObject.player stop];}
      [self repeatActionFire];
  }
  </code></pre>
  
  <p>In alphabet phonics code ,i need to modify the code.
  According the code my output is getting as :
  first it display the a.png image then apple image then ant image then b.png image but bat image is not displaying .how to do?</p>