From 40fe7dae1d7beb7e8c006943d4050f696e8edd31 Mon Sep 17 00:00:00 2001 From: Ariel Elkin Date: Sat, 8 Mar 2014 17:37:37 +0100 Subject: [PATCH] Update README.md --- STK for iOS/README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/STK for iOS/README.md b/STK for iOS/README.md index 589b256..b689f05 100644 --- a/STK for iOS/README.md +++ b/STK for iOS/README.md @@ -11,22 +11,28 @@ 1. Rename any Objective-C files that import STK files with the **.mm** extension. E.g. **ViewController.m** —> **ViewController.mm** +1. Look at the [iOS Demo project](..projects/demo/iOS%20Demo) for a sample usage. -1. Some classes (such as `Mandolin`, `Wurley`, or `Rhodey`) require you to copy the STK's raw wave files into your bundle. You'll know because you will be getting this runtime error: + +1. If you use a class that makes use of raw waves (such as `Mandolin`, `Wurley`, or `Rhodey`) you need to copy the STK's raw wave files into your bundle. You'll know you need to if you get this runtime error: `FileRead::open: could not open or find file (../../rawwaves/filename.raw)!` You then need to copy the rawwaves into your bundle. Open your project's settings, open the *Build Phases* tab. In the *Copy Bundle Resources*, drag and drop **rawwaves.bundle** (it's located in **STK.xcodeproj**'s **Helpers** folder). Add this code once in your app if using a class that needs the raw waves: -``` - NSBundle *rawwaveBundle = [NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"rawwaves" withExtension:@"bundle"]]; - - stk::Stk::setRawwavePath([[rawwaveBundle resourcePath] UTF8String]); +```objective-c +NSBundle *rawwaveBundle = [NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"rawwaves" withExtension:@"bundle"]]; +stk::Stk::setRawwavePath([[rawwaveBundle resourcePath] UTF8String]); ``` -If you get this error: `rawwaves.bundle: No such file or directory` +If you get a `rawwaves.bundle: No such file or directory` error: -Then select the rawwaves scheme, build it, then build your project's main scheme. +This means that **rawwaves.bundle** hasn't been copied to the build folder, so you'll need to do it manually: + +Select the rawwaves scheme: + + ![][rawwaves_scheme] +Build it (⌘+B) then build your project's main scheme. - +[rawwaves_scheme]: http://i.imgur.com/PKd7epf.png