Getting local declaration hides instance variable warning message for multiple statements
<p>I can't get this code to work.</p>

<p>Declared playpauseButton just above the given below statements</p>

<pre><code>UIButton *playpauseButton = [UIButton buttonWithType:UIButtonTypeCustom];
</code></pre>

<p>Getting local declaration of <code>playpauseButton</code> hides instance variable warning message for following statements</p>

<pre><code>playpauseButton addTarget:self action:@selector(playpauseAction:) forControlEvents:UIControlEventTouchUpInside];
playpauseButton.frame = CGRectMake(0, 0, 30, 30);
[playpauseButton setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateNormal];
[playpauseButton setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateSelected];
UIBarButtonItem *play = [[UIBarButtonItem alloc] initWithCustomView:playpauseButton];
</code></pre>

<p>After i defined <code>playpauseAction method</code> </p>

<pre><code>-(void)playpauseAction:(id)sender {    
if( playpauseButton.state == UIControlStateNormal ){
    [sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateSelected];
[audioPlayer play];
self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
                                    target:self
                                    selector:@selector(displayviewsAction:)
                                    userInfo:nil
                                    repeats:NO];
}  else if (playpauseButton.state == UIControlStateSelected)
{
[sender setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateNormal];
[audioPlayer pause];
 [self pauseTimer];
 } else if (playpauseButton.state == UIControlStateNormal)
{
[sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateSelected];
[audioPlayer play];
[self resumeTimer];}}
</code></pre>

<p>Some help please.</p>

<p>Thanks.</p>
