I’m using juce inside an iPhone application based on the MMI build with Interface builder.
The main procedure looks like this
[i]int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
ScopedJuceInitialiser_GUI jucePlugin;
int retVal = UIApplicationMain(argc, argv, nil, nil);
…
[/i]
When the application starts, an exception is triggered in the juce constructor
#2 0x0036ca2f in juce::UIViewComponentPeer::realScreenPosToRotated at juce_ios_UIViewComponentPeer.mm:215
#3 0x00348458 in juce::juce_updateMultiMonitorInfo at juce_ios_UIViewComponentPeer.mm:1003
#4 0x0022f060 in juce::refreshMonitorSizes at juce_Desktop.cpp:77
#5 0x0022f338 in juce::Desktop at juce_Desktop.cpp:44
#6 0x0022f4ae in juce::getInstance at juce_Desktop.cpp:60
#7 0x0022faa0 in juce::LookAndFeel::setDefaultLookAndFeel at juce_LookAndFeel.cpp:375
#8 0x0008dc2e in juce::initialiseJuce_GUI at juce_Initialisation.cpp:129
#9 0x001e5955 in juce::ScopedJuceInitialiser_GUI::ScopedJuceInitialiser_GUI at juce_Initialisation.h:122
The orientation is unknown in this method :
const Rectangle realScreenPosToRotated (const Rectangle& r)
{
const Rectangle screen (convertToRectInt ([[UIScreen mainScreen] bounds]));
switch ([[UIApplication sharedApplication] statusBarOrientation])
{
case UIInterfaceOrientationPortrait:
return r;
case UIInterfaceOrientationPortraitUpsideDown:
return Rectangle<int> (screen.getWidth() - r.getRight(), screen.getHeight() - r.getBottom(),
r.getWidth(), r.getHeight());
case UIInterfaceOrientationLandscapeLeft:
return Rectangle<int> (screen.getHeight() - r.getBottom(), r.getX(),
r.getHeight(), r.getWidth());
case UIInterfaceOrientationLandscapeRight:
return Rectangle<int> (r.getY(), screen.getWidth() - r.getRight(),
r.getHeight(), r.getWidth());
default: jassertfalse; // unknown orientation!
}
This happens on the last juce version.
Thanks for the help.