Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 0    Views: 227

Smugger than thou...
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
03/01/18 11:23 AM (3 years ago)

Sound Effect Errors in Xcode Simulator.

I get these. They're annoying. Sometimes I just don't want to plug in an iOS device to check something out.

I found a nice quickie. In your 'BT_soundEffectPlayer.m' file, paste this around line 34 or so, after the 'import' lines.

#include "TargetConditionals.h"

then, rearrange the 'loadSoundEffects' method to accommodate the device/simulator check:

[BT_debugger showIt:self message:[NSString stringWithFormat:@"loadSoundEffects%@", @""]];
// Simulator-specific code, or in my case, no code at all...
// load the code in the device, but not the simulator. No muss, no fuss.

//load sound effects in the background using Grand Central Dispatch...
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

... blah blah blah...
not pasting 'all' the code; you have it already. Just enough to show you to what should go where.
... blah blah blah...

[self.soundEffectPlayers addObject:tmpPlayer];

Hope this helps.


-- Smug

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.