diff --git a/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm b/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm index c5bd03eafe..8d862b3c8d 100644 --- a/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm +++ b/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm @@ -33,31 +33,6 @@ #include -//============================================================================== -@interface BluetoothSelectorView : NSObject - -@property (nonatomic, retain) CABTMIDICentralViewController *central; -- (UIView*) getView; - -@end - -//============================================================================== -@implementation BluetoothSelectorView - -- (instancetype) init -{ - self = [super init]; - self.central = [[CABTMIDICentralViewController alloc] init]; - return self; -} - -- (UIView*) getView -{ - return self.central.view; -} - -@end - namespace juce { @@ -73,8 +48,9 @@ public: setBounds (0, 0, getParentWidth(), getParentHeight()); toFront (true); - selectorView = [[BluetoothSelectorView alloc] init]; - nativeSelectorComponent.setView ([selectorView getView]); + controller = [[CABTMIDICentralViewController alloc] init]; + nativeSelectorComponent.setView ([controller view]); + addAndMakeVisible (nativeSelectorComponent); enterModalState (true, nullptr, true); @@ -82,10 +58,10 @@ public: ~BluetoothMidiSelectorOverlay() { - [selectorView release]; + nativeSelectorComponent.setView (nullptr); + [controller release]; } - void paint (Graphics& g) override { g.fillAll (Colours::black.withAlpha (0.5f)); @@ -114,8 +90,8 @@ private: setVisible (false); } + CABTMIDICentralViewController* controller; UIViewComponent nativeSelectorComponent; - BluetoothSelectorView* selectorView; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BluetoothMidiSelectorOverlay) };