# Combo box UI item anomaly on iOS AUv3

**URL:** <https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105>\
**Category:** MacOSX and iOS\
**Created:** [August 6, 2020, 2:14pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105 "2020-08-06T14:14:05Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![omn](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omn](https://forum.juce.com/u/omn)\
**Post date:** [August 6, 2020, 2:14pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/1 "2020-08-06T14:14:05Z")

</div>

Hi,

I am working on an iOS app and I have discovered that the Juce combo box menus won’t open on AUM when press on them, this is eventually the AUv3 version of the app. They work OK on the standalone version. Any experiences about this ? What would be a solution / replacement ?

---

<div class="post-metadata">

**Author:** ![omn](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omn](https://forum.juce.com/u/omn)\
**Post date:** [August 7, 2020, 11:45am UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/2 "2020-08-07T11:45:07Z")

</div>

I have tried to put a combo box on the AUv3SynthPlugin demo of Juce and this error pops up on Xcode output window, when I try to open the ComboBox on AUM.

This is OSX Catalina, Xcode 11.6, iOS13, and JUCE 5.4.4

**AUv3SynthPlugin[5401:2259218] [Window] Manually adding the rootViewController’s view to the view hierarchy is no longer supported. Please allow UIWindow to add the rootViewController’s view to the view hierarchy itself.**

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [August 7, 2020, 11:57am UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/3 "2020-08-07T11:57:28Z")

</div>

You can’t open desktop windows in an AUv3 plug-in - see this post:

> [@PopupMenu not showing on AUv3 plugin](https://forum.juce.com/t/popupmenu-not-showing-on-auv3-plugin/17763/10):
>
> OK. On the latest develop tip we’ve added support to “popup” a menu inside a parent component without the requirement of opening a separate window. This can be done in two ways: via the the new withParentComponent [PopupMenu::Options](https://www.juce.com/doc/classPopupMenu_1_1Options) option. For example, creating a popup embedded in the top-level component could be done in the following way: menu.showMenuAsync (PopupMenu::Options().withParentComponent (target.getTopLevelComponent()) .withTargetComponent (target), myCallback); or 2) Over…

As for the error shown in the console, this is unrelated but has been fixed on `develop`.

---

<div class="post-metadata">

**Author:** ![omn](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omn](https://forum.juce.com/u/omn)\
**Post date:** [August 7, 2020, 12:16pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/4 "2020-08-07T12:16:45Z")

</div>

do we have a replacement to the Combobox UI element of JUCE for AUv3 then ? Basically will Combobox UI work on AUv3 with this develop version as it works on standlalone ? What is the fix here on the licenced users level ( not the Juce developer level ) ?

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [August 7, 2020, 1:08pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/5 "2020-08-07T13:08:14Z")

</div>

Did you read the linked post? There is a solution for AUv3 plug-ins in there that uses a custom `LookAndFeel` which overrides the `getParentComponentForMenuOptions()` method.

What do you mean by “licensed”/“JUCE developer” levels?

---

<div class="post-metadata">

**Author:** ![omn](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omn](https://forum.juce.com/u/omn)\
**Post date:** [August 7, 2020, 1:54pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/6 "2020-08-07T13:54:56Z")

</div>

Hi Ed,

I assume that you are a member of JUCE developer team. If not, I am sorry in advance.

ComboBox UI item is a very fundamental element in JUCE UI category. My apps use it a lot and in different designs and I assume I am not alone.

I have announced that ComboBox does not work on AUv3 ( was not even sure if it was an issue of AUM or not ) where AUv3 is one of the product destinations of the JUCE multiplatfrom audio develpment framework.

You have replied this as I could not open desktop windows on AUv3 and popup a menu ? Well, I am trying to use the ComboBox UI item as I do use it on OSX, Windows and I see that there is no problem with iOS standalone neither.

Is there any JUCE documentation that I cannot use the ComboBox as it is on AUv3 ? Is there any replacement for this important UI item ? Should we find a way ourselves ?

And for your question regarding licenced user / JUCE developer : I am licenced user of JUCE , and am a professional. But I am not developing JUCE. I just expect that the responsibles take care of this multi platform framework and all these functionalities and methods keep working, especially for the most basic elements. It is not really anything special. My work will go on without any problem if these methods keep working , I will keep paying JUCE and it is as easy as it can be.

---

<div class="post-metadata">

**Author:** ![ed95](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ed95/32/7635_2.png) [@ed95](https://forum.juce.com/u/ed95)\
**Post date:** [August 7, 2020, 2:11pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/7 "2020-08-07T14:11:01Z")

</div>

Sure, JUCE is a multiplatform framework and therefore it tries to be the lowest common denominator for all of the platforms and plug-in APIs that it supports. AUv3 plug-ins have some quirks that don’t quite fit in nicely with the general “JUCE-y” API and one of these is that since AUv3s run in a separate, sandboxed process to the one that the actual plug-in window resides, opening “desktop” windows (like the `PopupMenu` that a `ComboBox` shows when it is opened) isn’t going to work.

One way of resolving this is to redesign your UI to only use sub-components of your editor window but, like you said, that would involve a lot of work on your end if you have an existing app which uses `ComboBox` in many places. Therefore there is a method in JUCE to allow you to open `PopupMenu`s as sub-components of a parent component instead of adding them directly to the desktop: overriding `PopupMenu::LookAndFeelMethods::getParentComponentForMenuOptions()` in a custom `LookAndFeel` class in your application, and applying this `LookAndFeel` to the app. Fabian added a nice piece of example code in the post I linked earlier which shows how to do this in a portable way which will use the default behaviour when not running as an AUv3 plug-in.

---

<div class="post-metadata">

**Author:** ![omn](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omn](https://forum.juce.com/u/omn)\
**Post date:** [August 7, 2020, 2:22pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/8 "2020-08-07T14:22:41Z")

</div>

well, that is wonderful news. Let’s get around this with the least amount of loss and work !

many thanks

---

<div class="post-metadata">

**Author:** ![omn](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omn](https://forum.juce.com/u/omn)\
**Post date:** [August 7, 2020, 7:20pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/9 "2020-08-07T19:20:13Z")

</div>

OK, it works. So I have to put that method below in all my LookAndFeel subclasses ?  
How about the future version of Juce ? I guess I will let know by then anyways.

cheers,

> Component\* getParentComponentForMenuOptions (const PopupMenu::Options& options) override  
> {  
> #if JUCE\_IOS  
> if (PluginHostType::getPluginLoadedAs() == AudioProcessor::wrapperType\_AudioUnitv3)  
> {  
> if (options.getParentComponent() == nullptr && options.getTargetComponent() != nullptr)  
> return options.getTargetComponent()-\>getTopLevelComponent();  
> }  
> #endif
> 
> ```
> return LookAndFeel_V2::getParentComponentForMenuOptions (options);
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![anon48770766](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon48770766](https://forum.juce.com/u/anon48770766)\
**Post date:** [May 16, 2022, 2:52pm UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/10 "2022-05-16T14:52:38Z")

</div>

I can’t get this LookAndFeel hack working on my project, using JUCE 6.1.6 - is there a new method of getting ComboBox’s working in an AUv3 target, per chance?

---

<div class="post-metadata">

**Author:** ![omn](https://avatars.discourse-cdn.com/v4/letter/o/9fc29f/32.png) [@omn](https://forum.juce.com/u/omn)\
**Post date:** [May 17, 2022, 6:01am UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/11 "2022-05-17T06:01:31Z")

</div>

I guess this is not in the best interest of the JUCE team. However the same hack works for me on Juce 6.1.6 as well. Otherwise the ComboBox won’t work on AUv3. A superb cross platform tool !

---

<div class="post-metadata">

**Author:** ![anon48770766](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon48770766](https://forum.juce.com/u/anon48770766)\
**Post date:** [May 17, 2022, 9:36am UTC](https://forum.juce.com/t/combo-box-ui-item-anomaly-on-ios-auv3/41105/12 "2022-05-17T09:36:24Z")

</div>

Thats fine, I just wonder how to make it work, because I’ve added this to my LaF class and … the popup menu’s do not appear. I suppose I will debug whats going on with LaF …
