added multiple actions @selector
<p>Have a playpause button on the mainviewcontroller. This button basically is toggling between play and pause buttons which is working fine. Now i added another action to playpause button. When i hit the play button it is not showing pageview at the sametime while toggling between play and pause.</p>

<pre><code>#import &lt;UIKit/UIKit.h&gt;
#import &lt;AVFoundation/AVFoundation.h&gt;
#import "ModalViewController.h"
#import "PageOneViewController.h"

@interface MainViewController : UIViewController &lt;ModalViewControllerDelegate&gt;

- (void)modalViewAction:(id)sender;

@property (nonatomic, retain) UIToolbar *toolbar;
@property (nonatomic, assign) UIBarButtonSystemItem currentSystemItem;
@property (nonatomic, retain) AVAudioPlayer *audioPlayer;
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ModalViewController *viewController;
@property (strong, nonatomic) UINavigationController *navigationController;
@property (strong, nonatomic) UIPageViewController *pageViewController;

@end



@synthesize pageViewController = _pageViewController;


UIButton *playpauseButton = [UIButton buttonWithType:UIButtonTypeCustom];
[playpauseButton addTarget:self action:@selector(playpauseAction:) forControlEvents:UIControlEventTouchUpInside];
[playpauseButton addTarget:self action:@selector(pageViewControllerAction:) forControlEvents:UIControlEventTouchUpInside];
playpauseButton.frame = CGRectMake(0, 0, 50, 50);
[playpauseButton setImage:[UIImage imageNamed:@"play.png"] forState:UIControlStateNormal];
[playpauseButton setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateSelected];
UIBarButtonItem *playpause = [[UIBarButtonItem alloc] initWithCustomView:playpauseButton];

-(void)playpauseAction:(id)sender 
{
    if ([audioPlayer isPlaying]){
        [sender setImage:[UIImage imageNamed:@"play.png"] forState:UIControlStateNormal];
        [audioPlayer pause];
    } else {
        [sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];
        [audioPlayer play];
    }    
}

- (void)pageViewControllerAction:(id)sender
{
    CGRect pageViewRect = self.view.bounds;
    pageViewRect = CGRectInset(pageViewRect, 40.0, 40.0);

    self.pageViewController.view.frame = pageViewRect;

    // Configure the page view controller 
    UIPageViewController *pageViewController = [[[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil]autorelease];

    NSArray *viewControllers = [NSArray arrayWithObject:pageViewController]; 

    [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

    [self.view addSubview:self.pageViewController.view];
}
</code></pre>

<p>Tried Exception breakpoint it is showing exception breakpoint at</p>

<p><code>[audioPlayer play];</code></p>

<p>also tried adding breakpoint at </p>

<p><code>-(void)pageViewControllerAction:</code></p>

<p>it is not executing that.</p>

<p>Any ideas what is going on. What i m doing wrong.</p>

<p>Thanks for help.</p>
