Skip to content

Instantly share code, notes, and snippets.

View ipmcc's full-sized avatar

ipmcc ipmcc

  • Equa Health
  • Pittsburgh, PA
View GitHub Profile
@ipmcc
ipmcc / OneShotAVAudioPlayer.h
Created August 24, 2013 14:18
A subclass of AVAudioPlayer that retains itself until playback ends or encounters an error, so you don't have to keep a strong reference to it. Supports pass-through to an exogenous delegate that gets set (which is captured in a zeroing weak reference). It's probably inadvisable to use this, but what the heck!
#import <AVFoundation/AVFoundation.h>
@interface OneShotAVAudioPlayer : AVAudioPlayer
@end