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

  • Home
  • SEARCH
  • 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 8603099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:14:40+00:00 2026-06-12T02:14:40+00:00

when a user taps on an image in the iPhone App page, I want

  • 0

when a user taps on an image in the iPhone App page, I want to first show a custom pop-up (which is a user message saying “your request is being processed”), “before” beginning the processing of the image-touch. But, somehow the processing begins (without even displaying the pop-up, though I have written the code to display the pop-up ‘before’ the processing code) & almost ends, & only then the pop-up is displayed. Can you please help?

This is the code snippet :

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    UITouch *touch = [touches anyObject];
    int emotionChosen = -1;
    [self showUserNote:msg];
    ...
    ...
    // This then calls a method to process the touch event
    ...
    ...
}

-(void) showUserNote:(NSString *)note {

    if ((self.viewCtrlrUserNote == nil) || (self.viewCtrlrUserNote == NULL)) {
        self.viewCtrlrUserNote = (ViewController_NoteToUser *) [((com_AppDelegate *) [[UIApplication sharedApplication] delegate]).storyboard instantiateViewControllerWithIdentifier:kNameViewCtrlrUserNote];
    }
    [self.viewCtrlrUserNote.view setFrame:CGRectMake(70.0,150.0,170.0,170.0)];
    [self.viewCtrlrUserNote initializeViewWithNote:note];
    [self.view addSubview:self.viewCtrlrUserNote.view];
    [self.view bringSubviewToFront:self.viewCtrlrUserNote.view];
}

Though am making the call to showUserNote (which should display the pop-up/dialogbox) “first”, “and then only” am calling the method which processes the touch. But the method to process the touch begins execution first & the dialog box appears only near the end of the processing-method, & so it destroys the very purpose!

My Dev Environment : XCode 4.3.3, iPad, iOS 5

How do I “mandate” it that iOS “first” displays the user dialog “before” beginning to process the touch event?

  • 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-12T02:14:41+00:00Added an answer on June 12, 2026 at 2:14 am

    Drawing and UI commands are generally not synchronous in CocoaTouch (or indeed, in any modern graphics API that uses 3D acceleration and compositing). When you do all the work in -showUserNote: you are queuing up commands to the view subsystem to do all of those things the next time it processes events, not actually doing them.

    The standard pattern to achieve what you want is to use delegation have it the view callback into the delegate once it has drawn. Apple uses this pattern in the UIAlert class, what you should do is get your code working using that instead of your custom view, then modify your custom view to have a delegate and call back into it once it has displayed.

    I highly recommend you read up on runloops so you can understand event processing and things like deferred processing.

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

Sidebar

Related Questions

I want to show different image for button after user taps that button ...
I want to make an app which contains an image, and when a user
I want to develop an app for WP7 using C# where a user taps
I am making a WP7 app that, when a user taps an image, randomly
I am trying to show a activity indicatorvw when user taps on the cell
i have just created a drum app. The user taps on the individual buttons
I'm writing a program for iPhone that will first let the user take a
In a universal app, I have a UIView which is presented inside an iPhone-Screen-Sized
I have an image, and there is a button. When user taps the button,
In my app, I want to set an image for a UILocalNotification . Whenever

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.