How to call a method within another method
<p>I placed resumeLayer and PauseLayer method definitions within the @interface and @end block in h file.</p>

<pre><code>@interface MainViewController : UIViewController

@property (nonatomic, retain) UIToolbar *toolbar;
@property (strong)AVAudioPlayer *audioPlayer;
@property (nonatomic, retain) NSTimer * timer;

- (void)resumeLayer:(CALayer *)layer;
- (void)pauseLayer:(CALayer *)layer;

@end
</code></pre>

<p>methods in m file</p>

<pre><code>-(void)pauseLayer:(CALayer*)layer
{
  CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
  layer.speed = 0.0;
  layer.timeOffset = pausedTime;
}

-(void)resumeLayer:(CALayer*)layer
{
  CFTimeInterval pausedTime = [layer timeOffset];
  layer.speed = 1.0;
  layer.timeOffset = 0.0;
  layer.beginTime = 0.0;
  CFTimeInterval timeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;
  layer.beginTime = timeSincePause;
 }
</code></pre>

<p>Now want to call <strong>resumeLayer and PauseLayer method in PlayPauseAction method</strong></p>

<pre><code>-(void)playpauseAction:(id)sender {

if([audioPlayer isPlaying])
{
    [sender setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateSelected];
    [audioPlayer pause];
    [self pauseTimer];
    [self pauseLayer: CALayer];

}
else
{
    [sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];
    [audioPlayer play];
    [self resumeTimer];

if(isFirstTime == YES)
    {
        self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
                                                      target:self
                                                    selector:@selector(displayviewsAction:)
                                                    userInfo:nil
                                                     repeats:NO];
        isFirstTime  = NO;
    }
   } 
  }
</code></pre>

<p>Now when i call </p>

<pre><code>[self PauseLayer:CALayer]; 
</code></pre>

<p>&amp;</p>

<pre><code>[self resumeLayer:CALayer]; 
</code></pre>

<p>gets message in red that <code>unexpected interface name CALayer expected expression</code>.</p>

<p>Anyone can please tell how to call <code>PauseLayer</code> and <code>resumeLayer</code> method in <code>playpauseAction</code> method.</p>

<p>Thanks for help.</p>
