2010-09-01 3 views
0

J'utilise avaudioplayer et je veux ajouter un bouton pour jouer le son mais je ne suis pas sûr de savoir comment. est ici code actuel:reliant un bouton à un certain son dans xcode?

#import UIKit/UIKit.h 

@class AudioPlayerViewController; 

@interface AudioPlayerAppDelegate : NSObject <UIApplicationDelegate> { 
    UIWindow *window; 
    AudioPlayerViewController *viewController; 
} 

@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet AudioPlayerViewController *viewController; 

@end 



#import "AudioPlayerAppDelegate.h" 
#import "AudioPlayerViewController.h" 

@implementation AudioPlayerAppDelegate 

@synthesize window; 
@synthesize viewController; 


- (void)applicationDidFinishLaunching:(UIApplication *)application {  

    // Override point for customization after app launch  
    [window addSubview:viewController.view]; 
    [window makeKeyAndVisible]; 
} 


- (void)dealloc { 
    [viewController release]; 
    [window release]; 
    [super dealloc]; 
} 


@end 

Répondre

0

trouvé quelques exemples de code dans les dev fourums !!

Questions connexes