1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Fix for iOS7 message boxes.

This commit is contained in:
jules 2013-12-08 15:12:38 +00:00
parent d63668a5c1
commit 66fb2e61a5

View file

@ -110,7 +110,7 @@ public:
iOSMessageBox (const String& title, const String& message,
NSString* button1, NSString* button2, NSString* button3,
ModalComponentManager::Callback* cb, const bool async)
: result (0), delegate (nil), alert (nil),
: result (0), resultReceived (false), delegate (nil), alert (nil),
callback (cb), isYesNo (button3 != nil), isAsync (async)
{
delegate = [[JuceAlertBoxDelegate alloc] init];
@ -137,7 +137,7 @@ public:
JUCE_AUTORELEASEPOOL
{
while (! alert.hidden && alert.superview != nil)
while (! (alert.hidden || resultReceived))
[[NSRunLoop mainRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]];
}
@ -147,6 +147,7 @@ public:
void buttonClicked (const int buttonIndex) noexcept
{
result = buttonIndex;
resultReceived = true;
if (callback != nullptr)
callback->modalStateFinished (result);
@ -157,6 +158,7 @@ public:
private:
int result;
bool resultReceived;
JuceAlertBoxDelegate* delegate;
UIAlertView* alert;
ScopedPointer<ModalComponentManager::Callback> callback;