# Juce components and cocoa touch UI classes

**URL:** <https://forum.juce.com/t/juce-components-and-cocoa-touch-ui-classes/5190>\
**Category:** General JUCE discussion\
**Created:** [April 22, 2010, 4:37pm UTC](https://forum.juce.com/t/juce-components-and-cocoa-touch-ui-classes/5190 "2010-04-22T16:37:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [April 22, 2010, 4:37pm UTC](https://forum.juce.com/t/juce-components-and-cocoa-touch-ui-classes/5190/1 "2010-04-22T16:37:16Z")

</div>

Easy question. I’ve done a ton of JUCE programming at this point, but less iPhone stuff. I’ve made a few iPhone apps with JUCE, but now I’ve gotten around to checking out the interface builder and iphones custom UI classes, and I’m wondering how/if I can get the two to work together.

Is there a proper way to cast a juce Component as an NSObject object, and embed it directly into a xib file?

Or perhaps as an openGL component of some sort?

Certainly this wouldn’t work with rotation and the other custom iPhone functions?

Are there any problems with including juce non-UI elements into iphone projects that use the Cocoa touch classes? How would I set up messaging between a juce audioProcessor or other juce element, and a non-Juce UI ?

Anyway, I’m sure I can find the limitations myself with a little experimenting, but thought it would be a good question to post here.

---

<div class="post-metadata">

**Author:** ![AaronLeese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/aaronleese/32/624_2.png) [@AaronLeese](https://forum.juce.com/u/AaronLeese)\
**Post date:** [May 1, 2010, 4:17pm UTC](https://forum.juce.com/t/juce-components-and-cocoa-touch-ui-classes/5190/2 "2010-05-01T16:17:16Z")

</div>

Aha !

Step one: Cocoa UI + Juce audio/etc.  
[http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=5326](http://www.rawmaterialsoftware.com/viewtopic.php?f=4&t=5326)

Very nice.

But of course, still no love in placing a juce component into a Cocoa touch UI. I’m guessing there might be some way to cast a juce component as a NSObject of some sort and add it as a custom UI object, but I’m kinda new to the Cocoa UI an interface builder.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 1, 2010, 9:51pm UTC](https://forum.juce.com/t/juce-components-and-cocoa-touch-ui-classes/5190/3 "2010-05-01T21:51:10Z")

</div>

If you use Component::addToDesktop, you can pass it a native window handle to add it to - in this case, you’d give it an NSView object.
