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 8028521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:09:40+00:00 2026-06-05T00:09:40+00:00

i have implemented textToSpeech in my project and want to display an alertview while

  • 0

i have implemented textToSpeech in my project and want to display an alertview while text is spoken. here i am calling the methods for textToSpeech:

//-----before TTS starts i try to display alertView with Cancelbutton  
//[self performSelectorOnMainThread:@selector(alertWhileTTS) withObject:nil waitUntilDone:YES]; //gray view and no alertview
//[self performSelector:@selector(alertWhileTTS)];  //gray view and no alertview
//[self alertWhileTTS];  //gray view and no alertview

//this part here is blocking, no gray screen, 
//after TTS is ready, the alertView is displayed
dispatch_async(dispatch_get_main_queue(), ^{
        //Update UI if you have to
        [self alertWhileTTS];
    });


[[self view] setNeedsDisplay];
[self synthesizeInBackground];
[queue waitUntilAllOperationsAreFinished];
[self setIsSpeaking: false];
[[self view] setNeedsDisplay];  

Here the synthesizeInBackground method(in method synthesize starts the TTS):

- (void) synthesizeInBackground {
    queue = [[NSOperationQueue alloc] init];
    operation = [[NSInvocationOperation alloc] initWithTarget:self 
    selector:@selector(synthesize) object:nil];

    [queue addOperation: operation];
}  

While TTS i want to display an alertView with cancel button. But in my case i am only getting a gray screen without the alertView.

How can i call alertWhileTTS correctly, so the alertView gets displayed?

here is the content of alertWhileTTS:

- (void) alertWhileTTS {
UIAlertView *inboxRead = [[[UIAlertView alloc] initWithTitle:@"Inbox tts..."
                                                    message:nil
                                                   delegate:self
                                          cancelButtonTitle:@"Abbrechen"
                                          otherButtonTitles:nil] autorelease];
inboxRead.tag = 997;

[inboxRead show];
}  

UPDATE see my solution, that works:

[self performSelectorOnMainThread:@selector(alertWhileTTS) withObject:nil waitUntilDone:YES];

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) {
        [[self view] setNeedsDisplay];
        [self synthesizeInBackground];
        [queue waitUntilAllOperationsAreFinished];
        [self setIsSpeaking: false];
        [[self view] setNeedsDisplay];

    }); 
  • 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-05T00:09:41+00:00Added an answer on June 5, 2026 at 12:09 am

    Change the alertWithTTsTo

    UIAlertView *inboxRead = [[[UIAlertView alloc] initWithTitle:@"Inbox tts..."
                                                        message:nil
                                                       delegate:self
                                              cancelButtonTitle:@"Abbrechen"
                                              otherButtonTitles:nil] autoRelease];
    inboxRead.tag = 997;
    
    [inboxRead show];
    

    Also dont forget to call the function alertWhileTTS from the main ui thread
    By doing

     dispatch_async(dispatch_get_main_queue(), ^{
            //Update UI if you have to
            [self alertWhileTTS];
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a tableView with a searchBar added to it. I want to
I have implemented SSO authentication using the sourceforge spnego project . This is my
I have implemented an object as a closure in JavaScript, some of the methods
I want to convert my current latitude,longitude text into speech.I have code for finding
I have implemented the Datepicker though Jquery <html> <head> <script type=text/javascript src=js/jquery-1.7.1.min.js></script> <script type=text/javascript
I have implemented authentication systems for webapps several times over the years, but before
I have implemented a Generic (n-ary) tree in Java as given here and by
I have text to speech all set up here (or so I think) but
I have implemented correctly bump's api, and added this code: - (void) configureBump {
I have implemented pagination to my data, but the problem is I only have

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.