How to add a delay, sleep() doesn't seem to work

I need to add a 1 second delay before calling a next function like
[self playStop];
sleep(1);
[self playGo];
But it just pause 1 second and then execute both playStop and playGo. Any idea?

Sleeping on the main thread is not a good idea as it will block UI updates as well - try using a timer instead:
[self playStop];
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(playGo) userInfo:nil repeats:NO];
Andreas

Similar Messages

  • How to add a delay step

    Hi,
    we have come across a issue in work flow. And we have very little idea on work flow.
    Can any one please let me know how to add a delay step behind existing step X.
    Also let me know how to do below options to perform this operation like 
    1. Like in ABAP delay for few seconds
    2. Or simply making use of desired start time logic.
    Thanks in advance.
    PRaneeth

    Delay?
    You mean that you want to stop the execution of the workflow for a specific period, right?
    Like in ABAP delay for few seconds
    This can be handled by using a WAIT STEP  of the workflow, I meanthe use of this wait step is , in brief, if at all you want to stop the execution of the workflow  until a specific Event is raisedthe workflow execution stops and as soon as the specified event is raised then the remaining part of the workflow is executed.

  • SQL Batch doesn't seem to work; How to eager-fetch related objects?

    Hi,
    I have two technical questions with Kodo.
    1. SQL Batch doesn't seem to work. I have tried batch size of -1, 0, 1, 25.
    But the performance from batch creating objects is not affected by batch
    size.
    kodo.jdbc.DBDictionary: BatchLimit=25
    2. How to use custom fetch groups to eagerly fetch related persistable
    objects? Example only showed attributes, not relationships.
    Enviroment:
    * Kodo 3.1.0 RC1
    * Oracle 9i release 1.
    Qingshan Luo
    Senior Software Engineer
    Open Harbor
    1123 Industrial Road
    San Carlos, CA 94070
    Phone: 650-413-4251
    Fax: 650-413-4298

    try poracle 10g driver. At least they fixed terrible CLOB bug may be batch
    to. BTW 9.2.x has problem with batching with deferred constraints so be
    careful
    "Greg Campbell" <[email protected]> wrote in message
    news:c3dmnu$rmj$[email protected]..
    >
    "Qingshan Luo" <[email protected]> wrote in message
    news:c3dg7q$mdl$[email protected]..
    Hi,
    I have two technical questions with Kodo.
    1. SQL Batch doesn't seem to work. I have tried batch size of -1, 0, 1,25.
    But the performance from batch creating objects is not affected by batch
    size.
    kodo.jdbc.DBDictionary: BatchLimit=25You may be running into a bug in the Oracle 9.2 driver. That driverdoesn't
    reliably give update counts when using batching and prepared statement
    caching. By default, Kodo will turn off batching. You can manuallyenable
    batching by setting the BatchLimit on your DBDictionary, as you've done.If
    you do this, though, you may want to turn off prepared statement cachingby
    setting MaxCachedStatements to 0 (see
    http://www.solarmetric.com/Software/Documentation/3.1.0RC1/docs/ref_guide_dbsetup.html#ref_guide_dbsetup_builtin).
    >
    2. How to use custom fetch groups to eagerly fetch related persistable
    objects? Example only showed attributes, not relationships.You can find information on setting up eager fetching of relations at
    http://www.solarmetric.com/Software/Documentation/3.0.3/docs/ref_guide_
    perfpack_eager.html
    Basically, you'll need to add the relations to your fetch group, and
    set the eager fetching mode.
    Enviroment:
    * Kodo 3.1.0 RC1
    * Oracle 9i release 1.
    Qingshan Luo
    Senior Software Engineer
    Open Harbor
    1123 Industrial Road
    San Carlos, CA 94070
    Phone: 650-413-4251
    Fax: 650-413-4298

  • I have Adobe Design Standard CS6 purchased 2013 with serial number but cannot find to download it onto a new mac laptop. When I try and add the 24-digit serial number to my account it doesn't seem to work?

    I have Adobe Design Standard CS6 purchased 2013 with serial number but cannot find to download it onto a new mac laptop. When I try and add the 24-digit serial number to my account it doesn't seem to work?

    CS6 - http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html
    You can also download the trial version of the software thru the page linked below and then use your current serial number to activate it.
    Be sure to follow the steps outlined in the Note: Very Important Instructions section on the download pages at this site and have cookies enabled in your browser or else the download will not work properly.
    CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • How do I remove the menu button? The Customize option doesn't seem to work for that.

    How do I remove the menu button? [That IChing looking three line icon on the toolbar.]
    The toolbar Customize option doesn't seem to work, and it seems a waste to have a button that duplicates the menus. I'd like to swap it out for the NoScript icon.

    Hi, ''I can't recommend that you do it'', but If you really are determined, [http://www.tweakguides.com/Firefox_12.html this article] may help.

  • How do you close programs with new iOS7? Old way doesn't seem to work!

    How do you close programs with new iOS7? Old way doesn't seem to work!

    After double tap home button, swipe up on the app card that appears above the icon.

  • How to reset the iPad - the Location Services doesn't seem to work?

    How to reset the iPad - the Location Services doesn't seem to work?
    I can not get NFL Game Pass or Siri to work???

    Well you can plug it into itunes and under summary tab hit RESTORE. This should fix any software issues that you may be experiencing. About gamepass, I dont know, I dont have it. Siri is not on the IPAD2. Only on the 3rd generation Ipad, so you wont have it(going by ipad2 under your name).

  • How do you reset/repair javascripts? Enabling doesn't seem to work

    When I enter various websites, they list an advisory message that I must enable javascripts in order to use their sites. When I enable javascripts from the contents section from tools in firefox, it doesn't seem to work. How can I reset or repair the javascripts function in the firefox program to allow me to access and use various websites?

    The website you mentioned http://www.arbitersports.com is opening fine (see attached screenshot) without any error messages or warnings on my Win Xp & Firefox 9.0.1..
    -> [[JavaScript]]
    * http://kb.mozillazine.org/JavaScript
    -> [[Using the Java plugin with Firefox]]
    -> Perform the suggestions mentioned in the following articles:
    * [https://support.mozilla.com/en-US/kb/Template:clearCookiesCache/ Clear Cookies & Cache]
    * [[How to clear the cache#w_clear-the-cache|Clear the Network Cache]]
    * [[Troubleshooting extensions and themes]]
    Check and tell if its working.
    -> Update Firefox to the latest version (9.0.1)
    * [[Updating Firefox]]
    -> Update All your Firefox Plugins
    * https://www.mozilla.org/en-US/plugincheck/
    * '''When Downloading Plugins Update setup files, Remove Checkmark from Downloading other Optional Softwares with your Plugins (e.g. Toolbars, McAfee, Google Chrome, etc.)'''
    * Restart Firefox

  • My 2 year old has deleted my 'apps store' icon and I cannot figure out how to get it back? Doesn't seem to be available in the on-line apps store, ironically enough

    My 2 year old has deleted my 'apps store' icon and I cannot figure out how to get it back? Doesn't seem to be available in the on-line apps store, ironically enough

    He dragged the icon out of the dock at the bottom and disappeared. That icon is merely a "shortcut" that opens the application when you click on it.
    You still have the app. Open your applications folder and look for the App Store app icon. Click and hold down on the App Store icon and drag the icon down into the dock to replace it. That puts the shortcut back into the dock.

  • Hi, I have photoshop CC. It's the french version but I would like to have it in english. I went in the creative cloud to change the language but it doesn't seem to work. Do you know how i could do it ?

    Hi, I have photoshop CC. It's the french version but I would like to have it in english. I went in the creative cloud to change the language but it doesn't seem to work. Do you know how i could do it ?

    Please indicate whether or not the following link helps... I have not had to use it and so I do not know if/when it does help.
    Creative Cloud Help / Adjust the install language | Creative Cloud applications | CCM -
    http://helpx.adobe.com/creative-cloud/kb/change-installed-language.html

  • HT1296 How can I transfer a ringtone from my iPad to my iPhone? Syncing doesn't seem to work.

    How can I transfer a ringtone from my iPad to my iPhone? Syncing doesn't seem to work.

    See this discussion: https://discussions.apple.com/message/22514325#22514325

  • I would like to cancel my subscription for Adobe ExportPDF Subscription that I have just signed up for as it doesn't seem to work with my system. How do I do this ?many thanks suslucie

    I would like to cancel my subscription for Adobe ExportPDF Subscription that I have just signed up for as it doesn't seem to work with my system. How do I do this ?many thanks suslucie

    Hi Susan,
    I checked using the email you provided, and there's no history of any orders under that email address. (Then, I removed your email address from you post, since this is a public forum and it's best not to broadcast contact information.)
    I'll message you privately, and you can send along your email from Adobe if you'd like.
    Best,
    Sara

  • How to reflect db changes - Verify Database doesn't seem to work

    I have changed a database (MS SQL Server) column from varchar 255 to varchar 1000, but the designer doesn't pick up the change.
    I read that db changes can be picked up by using 'Verify Database' feature. It doesn't seem to work for us though. Is there any configuration to turn on for the feature to work properly or any work-around to refresh the database changes?
    We are making the database connection using JDBC (JNDI) option since the report is being used in a Java web application.
    Any comments or insights will be very much appreciated!

    Hi Wallie,
    Thank you very much for your reply! Here are the answers to your questions.
    Are you able to create a new report off the modified database?
    ==> Yes.
    Do new reports see the changes made to the database?
    ==> No.
    Are the reports connecting directly to the database table, or is it a stored procedure, business view, universe being used?
    ==> Through a business view.
    By the way, after trying so many things, I was able to figure out the reason. Since the report is using a view, not directly the table, the view itself had to be recompiled to reflect the table changes so that the view could pass the changes to the report. It was a very good thing to know. Your last question could have been a very helpful insight for this issue! Thank you so much again!

  • SetDocument doesn't seem to work correctly

    I'm obviously using the setDocument method for my JTextField incorrectly, but how? The DocumentSizeFilter works correctly, allowing only the number of characters I specify, but the DigitDocument.insertString(...) doesn't seem to work at all (it should allow for only digits to be entered into the JTextField).
              AbstractDocument doc;
              pafTextField = new JTextField();
              pafTextField.setDocument(new DigitDocument());
              pafTextField.setPreferredSize(new Dimension(30, height));
              doc = (AbstractDocument)pafTextField.getDocument();
              doc.setDocumentFilter(new DocumentSizeFilter(2));The DigitDocument class:
    public class DigitDocument extends PlainDocument{
         public DigitDocument(){
              super();
         public void insertString(int offs, String str, AttributeSet a) throws BadLocationException, NumberFormatException{
              try{
                   System.out.println("String str = " + str);
                   int i = Integer.parseInt(str);
                   super.insertString(offs, str, a);
              catch(NumberFormatException e){
                   // do nothing because a user input was not a digit
                   Toolkit.getDefaultToolkit().beep();
    }the DocumentSizeFilter code:
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/DocumentSizeFilter.java

    didn't try the abstract doc, but why not combine the two
    something like this
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.text.*;
    class Testing extends JFrame
      public Testing()
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JTextField tf = new JTextField(new DigitDocument(2),"",10);
        JPanel p = new JPanel();
        p.add(tf);
        getContentPane().add(p);
        pack();
      public static void main(String[] args){new Testing().setVisible(true);}
    class DigitDocument extends PlainDocument{
      int maxChars;
      public DigitDocument(int chars){
        super();
        maxChars = chars;
      public void insertString(int offs, String str, AttributeSet a) throws BadLocationException, NumberFormatException{
        try{
          System.out.println("String str = " + str);
          if(this.getLength()+str.length() > maxChars) throw new NumberFormatException();//<----
          int i = Integer.parseInt(str);
          super.insertString(offs, str, a);
        catch(NumberFormatException e){
          // do nothing because a user input was not a digit
          Toolkit.getDefaultToolkit().beep();
    }

  • Email Security Plug-in - Doesn't seem to work with right click or save and send

    I've searched the knowledge base but have not located the answer yet.
    We have the Encrypt Message plug-in installed to flag the email [SEND SECURE].  This works very well when in Outlook.  It does not seem to work when right clicking a file to send outside of Outlook or performing Save and Send from within Microsoft Office.  The add-in still shows and users are clicking it and the Send button but the emails are not going securely.  We are on Microsoft2010 on mostly XP machines.
    How can I get Encrypt Message to work in all instances?
    Thank you.
    Starla

    Andreas
    I am getting an error.  See below for what I'm choosing and the response.  let me know if I'm supposed to be trying to download from another area.
    Thanks
    Starla
    Email Security Plug-in - Doesn't seem to work with right click or save and send
    Cisco IronPort Email Security Appliance C370
    Release:IPAS
    Filename: CiscoEmailSecurity_7-2-0-039.exe
      Remove
    Details
    Release
    IPAS
    Filename
    CiscoEmailSecurity_7-2-0-039.exe
    Release Date
    25/Oct/2011
    Description
    Cisco IronPort Email Security Plug-in (Outlook)
    Size
    32541.84375 KB (33322848 bytes)
    Router Checksum
    0x553f
    MD5
    f0c864697d9e1a3e8f5297062943ac50
    Email Security Plug-in - Doesn't seem to work with right click or save and send
    Save the device to 'My Added Devices' list
    More Info
    'My Added Devices' list could be found by: 1. Clicking on 'My Cisco' Tab and expanding
        the 'Added Devices' section. 2. Selecting any task specific product
       selector and clicking on 'My Added
        Devices' in left pane.
    Email Security Plug-in - Doesn't seem to work with right click or save and send
    Set Cisco Notification Alert
    More Info
    All 'Cisco Notification Alerts' list could be found
    by: 1. Clicking on 'My Cisco' Tab and expanding
        the 'Support Notifications' section.
    Cisco service contract information indicates you are not authorized to download software for the following product(s):
    Cisco IronPort Email Security Appliance C170
    Cisco IronPort Email Security Appliance C370
    Cisco IronPort Email Security Appliance C650
    To download software for other product(s), remove the software for the product(s) listed above.
    Or, if you feel this message is in error, please:
    1. Email technical support for 24x7 assistance. To expedite your request, please include the following information:
             User ID (Cisco.com ID used to download software)
             Contact Name
             Company Name
             Contract Number
             Product ID
             Desired Software Release or File Name
    2. Contact your Cisco Representative, Partner or Reseller to ensure product(s) listed above are covered on a service contract. The Partner Locator link may assist in locating your nearest partner.
    3. Associate contracts for those products to your Cisco.com profile using the Instructions found in Profile Manager. After you submit your additional contracts, verification and updates may take up to 6 hours to complete.

Maybe you are looking for