Fix in-app audio

- sound is set by passing in reference
- don't access properties in constructor
- distinguish multiple variables with same name

// FREEBIE
pull/1/head
Michael Kirk 9 years ago
parent df63c8624d
commit f899cff128

@ -25,15 +25,17 @@
@implementation NotificationsManager
- (instancetype)init {
- (instancetype)init
{
self = [super init];
if (self) {
NSURL *newMessageSound =
[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"NewMessage" ofType:@"aifc"]];
self.newMessageSound = AudioServicesCreateSystemSoundID((__bridge CFURLRef)newMessageSound, &_newMessageSound);
if (!self) {
return self;
}
NSURL *newMessageURL = [[NSBundle mainBundle] URLForResource:@"NewMessage" withExtension:@"aifc"];
AudioServicesCreateSystemSoundID((__bridge CFURLRef)newMessageURL, &_newMessageSound);
return self;
}

Loading…
Cancel
Save