Log in or register to post comments

UI changes from within EAGLVIiew's renderFramceQCAR

February 17, 2014 - 2:22am #1

Hello together :)

So I have custom UIView Elements shown on top of the camera image which works fine. Now I want to set them to hidden by default and only show them, if a specific Image Target is detected. So I tried calling setHidden:NO in renderFrameQCAR but the elements don't show up. I figured that the problem is, that renderFrameQCAR runs on a background thread and the UI must be updated on the main thread, but calling the selector which updates the UI via performSelectorOnMainThread: doesn't really work either. Does anybody else know a solution for this problem? Thanks in advance!

UI changes from within EAGLVIiew's renderFramceQCAR

February 19, 2014 - 5:16am #6

Great to hear :)

N

UI changes from within EAGLVIiew's renderFramceQCAR

February 19, 2014 - 5:15am #5

Thanks for your reply NalinS. I got it to work using the newest samples. Don't ask me why it didn't work using the old samples as I used the exact same code. 

In case anyone wonders how to do this:

Updating UIView objects can only be done on the main thread, therefore a performSelectorOnMainThread call is necessary.

UI changes from within EAGLVIiew's renderFramceQCAR

February 18, 2014 - 8:49am #4

Other developers have managed to do this and it may be worth searching the forums for more precise steps:

https://developer.vuforia.com/forum/ios/uibutton-overlayviewcontroller

However, note that the samples have changed somewhat, so you will need to adapt any changes.

 

N

UI changes from within EAGLVIiew's renderFramceQCAR

February 18, 2014 - 8:32am #3

NalinS wrote:

but calling the selector which updates the UI via performSelectorOnMainThread: doesn't really work either

What exactly do you mean by this?

It either works or it does not...

 

N

Sorry I wasn't clear. The view I try to show remains hidden although the method which calls setHidden:YES gets called as I was able to verify with breakpoints.

UI changes from within EAGLVIiew's renderFramceQCAR

February 18, 2014 - 2:38am #2

but calling the selector which updates the UI via performSelectorOnMainThread: doesn't really work either

What exactly do you mean by this?

It either works or it does not...

 

N

Log in or register to post comments