Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8911909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:04:02+00:00 2026-06-15T04:04:02+00:00

I have a main view (or a scene in cocos2d) that opens when the

  • 0

I have a main view (or a scene in cocos2d) that opens when the app is starts .
from there i call the audioUnit to listen to the input audio that comes from microphone .
it works great (the callbacks on audioUnit are called always and do stuff) , but i can see that it takes the main thread- something that i dont want because the main scene has UILabel and other stuff that needs to be the main thread in order to be changed .

at the main scene i do at the start :

remoteIns=[[remoteIO alloc]init]; //turn on the callback function on class remoteIO .
[remoteIns StartListeningWithFrequency]; // this function takes the main thread

then when i check in the main scene later with :

NSLog(@"isMainThread%d",[NSThread isMainThread]);

i can see it’s not the main thread ,hence i cant change UILabels in it .

I need to start the audioUnit function (another class) and set it to be in another thread, keep the main scene to be the main thread, and let the audioUnit work good .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T04:04:04+00:00Added an answer on June 15, 2026 at 4:04 am

    The audio Unit is not in the main thread.
    But the main scene is also not in the main thread.

    In order to change the UILabel on the main scene , it most be the main thread, so i change its text with this : (its being called in the scene observer to call a function that changes the text :

    [self performSelectorOnMainThread: @selector( updateText: ) withObject: bits waitUntilDone: YES];
    

    and in updateText: i change the text. it works great .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main view. From that main view I show a modal view
I have a main view controller that consists of 1 button that when tapped,
In my Backbone application I have a main view that shows previews of posts.
I'm developing an iOS 4 application. I have a main view that contains another
I'm trying to write my first simple mvc app. I have a Main View
I have an Android app with a ListActivity in the main view. The list
I have my main app view controller (File's Owner), its First Responder, View, and
I have a main view controller that takes care of the drawing for my
I have a main view that manually creates a UIViewController (not a UINavigationController) and
My application is set up using ViewFlipper so that I have one main View

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.