2010-09-01 34 views
0

我正在使用avaudioplayer,並想添加一個按鈕來播放聲音,但我不知道如何。 下面是當前的代碼:將按鈕連接到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 

回答

0

發現了一些示例代碼在開發項評分!