我是个新手。一旦新的视图控制器在viewdidload下加载,我就会播放音频声音,但是现在我将如何从内存中删除它以便如果你回到那个视图控制器它仍然会再次播放音频?
@implementation FFViewController
-(void)viewDidAppear:(BOOL)animated
{
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"crash",
CFSTR ("wav"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundFileURLRef, &soundID);
AudioServicesPlaySystemSound (soundID);
}
- (void)viewDidLoad