Mac OSX to iOS


#1

Hello,

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


#2

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.


#3

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


#4

Yep, JUCE_MAC and JUCE_IOS.


#5

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.


#6

Carbon doesn’t exist in iOS.


#7

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


#8

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


#9

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


#10

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”)


#11

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.


#12

Hello,

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


#13

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.