iOS (iPad/iPhone) - how I got the Juce Example working

Right, here are the steps I followed to get the Juce example project built for iOS - the Juce example project for iOS is broken for me (http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=6370)

  1. Created new iOS Windows-based project; marked as Universal so it works nicely on both iPad and iPhone
  2. Removed the two Nib references from the generated .plist file, and removed the two generated .xib files from the project (if you don’t do this, the internal call to UIApplicationMain will try to drive everything through Xib files, and will fail to call the Juce UI application delegate code; your main app class won’t be constructed, and you’ll be staring at a blank Window!).
  3. Added compiler flags: Release: -DNDEBUG=1, and Debug: -D_DEBUG=1 to avoid warnings from Juce
  4. Set the iOS target to 3.1.3 (rather than the default of 4.2) - lets your app run on more devices!
  5. Removed the generated app delegate files from the project
  6. Dragged all juce files from the juce demo project, into to my generated project: however, do NOT copy-across the .icns file and the .plist file!
  7. Drag-in all Frameworks from the Juce project, to your generated project; this tops-up the list of frameworks that your generated app can use…
  8. Build project
  9. Debug project

Should all work if I haven’t missed anything!
Amazing to see the Juce demo running in the iOS Simulator. :slight_smile:

Jules, are you aware of any UI things in Juce that might get Juce-based apps blocked from the app store, without tweaking?

Couple of comments to note:

  • by default, the generated app has a close button in the top right; IIRC the Apple guidelines say that this is a no-no - apps mustn’t be dismissed by anything other than the main physical device button…
  • I’ve yet to investigate what happens wrt rotation events, multi-touch, or where I hook-in code to save app state when the app is terminated/backgrounded/returned from the background (nb if you want an app to be backgroundable, that requires flags in your .plist file and also some additional code). Jules, are you planning to add handlers to the Juce framework to cater for this sort of thing, or will we have to hack-around the Juce sources for iOS?

Best wishes,

Pete

I’ve just updated the jucer to fix the XCode projects for iPad/iPhone. It just needed a few tweaks, as Apple must have changed a few settings recently. I think it should all just work “out-of-the-box” now if anyone wants to try it…

Would anyone be kind enough to post some info about how to do this? Thanks.

Would anyone be kind enough to post some info about how to do this? Thanks.[/quote]

I just managed to answer my own question (just incase anyone finds this via a forum search in the future). See . . .

http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=8080&hilit=background+iOS

and