Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 0    Views: 479

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
03/01/18 11:23 AM (6 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: -(void)loadSoundEffects{ [BT_debugger showIt:self message:[NSString stringWithFormat:@"loadSoundEffects%@", @""]]; #if TARGET_OS_SIMULATOR // Simulator-specific code, or in my case, no code at all... #else // 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]; } } }); #endif } Hope this helps. Cheers! -- 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.