开发者

linking a button to a certain sound in xcode?

开发者 https://www.devze.com 2023-01-13 18:36 出处:网络
I\'m using avaudioplayer and want to add a button to play the sound but i\'m not sure how to. Here\'s current code:

I'm using avaudioplayer and want to add a button to play the sound but i'm not sure how to. Here's current code:

#import UIKit/UIKit.h

@class AudioPlayerViewController;

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

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet开发者_StackOverflow社区 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


found some sample code in the dev fourums!!

0

精彩评论

暂无评论...
验证码 换一张
取 消