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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:50:18+00:00 2026-05-26T07:50:18+00:00

I have to create an app for iDevice from another app what i created

  • 0

I have to create an app for iDevice from another app what i created for android. I need to show a dialog for only two seconds. In android i uses this code:

public class ThreadW extends Thread{
    private Handler handler;
    public ThreadW(Handler handler){
       this.handler=handler;
    }
    public void run(){
        notifyM("start");
        Thread.sleep(2500);
        notifyM("stop");
    }
    private void notifyM(String message){
        Message msg = handler.obtainMessage();
        Bundle b = new Bundle();
        b.putString("Dialog", message);
        msg.setData(b);
        handler.sendMessage(msg); 
    }
}

And handler:

public class HandlerWelcome extends Handler {
    private DialogWelcome w;
    private Context c ;
    public HandlerWelcome(Context c){
        this.c=c;
    }
    public void handleMessage(Message msg) {
        Bundle bundle = msg.getData();
        if(bundle.getString("Dialog").equals("start")){
            w = new DialogWelcome(c);
            w.show();
        }else if(bundle.getString("Dialog").equals("stop"))
            w.cancel();
    }
}

And i use all in this way:

ThreadW tw = new Thread(new HandlerWelcome(c));
tw.start();

How can i do the same in objective c?

  • 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-05-26T07:50:18+00:00Added an answer on May 26, 2026 at 7:50 am

    Here is a solution which uses Grand Central Dispatch (GCD):

    // Call this method on the main thread
    - (void)showWelcomeMessage
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" 
                                                        message:@"Have a nice day!" 
                                                       delegate:nil 
                                              cancelButtonTitle:nil 
                                              otherButtonTitles:nil];
        [alert show];
    
        dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*2.0);
        dispatch_after(delay, dispatch_get_main_queue(), ^{
            [alert dismissWithClickedButtonIndex:0 animated:YES];
        });
    
        [alert release];
    }
    

    However, you should create a custom alert dialog since iOS users won’t be expecting a standard alert dialog to automatically disappear.

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

Sidebar

Related Questions

I have created an App Widget for Android 1.5. It uses a TextView to
Everybody.. I have create one universal application.. My app worked fine to only two
I have to create an app that will read in some info from a
I have a Grails 2.0.0 project that was created using grails create-app . In
i develope an app for android ad i have to create the same app
i have create map in app. i want to show check-ins in it. i
I have two paid apps on app store. I want to create one app
I will have to create an offline app from a received html5 file (sort
I'm helping a friend create an android app that will have screens with lists
i have create Facebook app for my external website and i created an Access

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.