Mac OSX to iOS


I am currently working on some way to adapt an existing mac OSX JUCE app for iOS. Could someone help me in some way (steps, or advices)?

Thank you

You should be able to pretty-much run it without any changes! Then it’s just a case of deciding how to change your UI design for a touch-based screen.

Thanks! Is there a Juce macro I could use to identify the os (Mac OSX or iOS) using ifdef?

Thank you again for the help


Hmm… Okay, here are what I need to include: #include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>

If they’re not, I get some compilation errors. If I add: #ifdef JUCE_IOS and #endif the headers are not included and I get the errors. Of course, I am currently on an iOS project.

Carbon doesn’t exist in iOS.

Oh, well ok. But I need #include <CoreServices/CoreServices.h> for an error I get with UInt32s. The #ifdef JUCE_IOS doesn’t work…

How is that problem related to JUCE? Sounds like you’re having trouble with your own code.

I’m just searching for a macro that would help distinguishing between macintosh users and ipad users

Well that macro is definitely defined in juce_PlatformDefs.h so make sure you have included that file before you try to use the macro. This is usually included through the core module header which gets included by your AppConfig header and therefor your JuceHeader.h under your application’s JuceLibraryCode directory.

(Basically you can’t use it until you include “…/JuceLibraryCode/JuceHeader.h”)

Anywhere that you can use juce symbols, that macro will definitely be defined. Unless you’re using an ancient version of juce before it was added.


I have another question, what do you use instead of “setMacMainMenu” if you are on an iPad? I’ve tried to look into what you’ve done for the juceDemo but don’t really get it.
Thanks a lot for your help

The iPad doesn’t have a menu bar!

The juce demo is just a non-native menu bar, but TBH it really isn’t appropriate to have anything like that on a touch-screen device.