Delay/sleep/wait in an iPhone SDK app?

I'm trying to get some numbers to count up on the screen of my iPhone, but I can't see any way of delaying the app.
I have a for loop that changes the figures on-screen from one value to another by individual increments, but when I run it, you only see the final figure because it runs so fast.
Is there a way of adding a delay in the for loop so that the numbers visibly change? I'd like to see 0 change to 1 change to 2 change to 3 etc. instead of, erm, just 3.
I thought of putting a second for loop in that counted up to, say, a million, but that's too fudgey for me. I'm sure there's a delay function in the iPhone SDK...

You can also do eg. [NSThread sleepForTimeInterval:5.0] to sleep for 5 seconds..

Similar Messages

  • IPhone SDK 3.1: Problem compiling first Hello World App

    Hi,
    I am new to XCode, Mac OS and iPhone Development.
    I had already installed the earlier iPhone SDK (version prior to the latest 3.1) into my Mac OS 10.6. I was not able to run
    the hello world program through xCode as while opting for Build and Run, the simulator it was giving me an error saying that it cannot find the right SDK.
    I had assumed that the old SDK is not compatible with the new Mac OS 10.6 (Snow Leopard). I had then uninstalled the old
    iPhone SDK using Terminal tool, using the command line given in the xCode uninstall guide.
    Installed the latest iPhone SDK (version 3.1), and then tried to compile the hello world app through xCode. Now I am getting the following error:
    *error: can't exec '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2' (No such file or directory*)
    I had located the above mentioned directory and could not find the file: "gcc-4.2" as mentioned in the error. Instead
    executable files like "i686-apple-darwin10-gcc-4.2.1" are present there.
    My Project Settings are:
    Project Format - xcode 3.2 -compatible
    Base SDK - iPhone Simulator 3.1
    Compiler Version - System Default (GCC 4.2)
    I am totally confused here, as I don't know how to correctly set up the ENV, as I thought the iPhone installer SDK does that automatically.
    Please help me out.
    Thanks in advance for your time,
    JC.
    Error Messages:
    Build helloworldxc of project helloworldxc with configuration Debug
    ProcessPCH /var/folders/P-/P-zMg0EzHree36VYyqKEvU+TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/helloworldxcPrefix-gylsydenhucpkgfnujlgvzvhfhzd/helloworldxcPrefix.pch.gch helloworldxc_Prefix.pch normal i386 objective-c com.apple.compilers.gcc.4_2
    cd "/Users/jaideepchakravorty/Jaideep/R&D/helloworldxc"
    setenv LANG en_US.US-ASCII
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr /bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -x objective-c-header -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_IPHONE_OS_VERSION_MINREQUIRED=30000 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1 .sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/helloworldxc.build/Deb ug-iphonesimulator/helloworldxc.build/helloworldxc-generated-files.hmap -I/Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/helloworldxc.build/D ebug-iphonesimulator/helloworldxc.build/helloworldxc-own-target-headers.hmap -I/Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/helloworldxc.build/D ebug-iphonesimulator/helloworldxc.build/helloworldxc-all-target-headers.hmap -iquote /Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/helloworldxc.build/Deb ug-iphonesimulator/helloworldxc.build/helloworldxc-project-headers.hmap -F/Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/Debug-iphonesimulato r -I/Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/Debug-iphonesimulato r/include -I/Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/helloworldxc.build/D ebug-iphonesimulator/helloworldxc.build/DerivedSources/i386 -I/Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/build/helloworldxc.build/D ebug-iphonesimulator/helloworldxc.build/DerivedSources -c /Users/jaideepchakravorty/Jaideep/R&D/helloworldxc/helloworldxc_Prefix.pch -o /var/folders/P-/P-zMg0EzHree36VYyqKEvU+TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/helloworldxcPrefix-gylsydenhucpkgfnujlgvzvhfhzd/helloworldxcPrefix.pch.gch
    while compiling hellowworldxc_Prefix.pch,
    error: can't exec '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2' (No such file or directory)

    Could you let me know as where is the xcode setting through which it is looking for the compiler in the following path ? This path is probably wrong (Pls refer to the error messages)
    I'm not sure this will be of any help to you -- I'm not sure if it's the answer you're looking for, since I don't really know enough on the subject. However, this may answer your question, or at least maybe help you find the answer for yourself, so it's worth a shot. Try going to Edit Project Settings in the Project menu, and once the Project Settings open, select the Build tab. Search through this and see if you find any preferences along the lines of what you are looking for. In particular I would try the sections toward the bottom about the GCC 4.0 compiler. Sorry if this was a waste of time, but I wanted to try...

  • TS2446 hi my apple id has been disable, as i has purchased more than 1000$ from app store and i have to update my apps and also i have planning to purchased more apps i will be appreciate if you activate my apple id. i am impatiently waiting for new iphon

    hi
    my apple id has been disable,
    as i has purchased more than 1000$ from app store and i have to update my apps and also i have planning to purchased more apps i will be appreciate if you activate my apple id.
    i am impatiently waiting for new iphone.
    i hope to buy many apps with this apple id and enjoy  them
    Viva Apple

    These are user-to-user forums, you are not talking to Apple here.
    Depending on why it's been disabled, you might be able to re-enable it via this page : http://appleid.apple.com
    Or you might need to contact Apple : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • IPhone 4 apps stuck at "Waiting"

    Recently upgraded my iPhone 4 to iOS 7 (big mistake). One of the (many) issues that I have been having with it since related to my attempts to update an app. In the app store, I hit the "update" link on the page for the ONE app that I was trying to update... phone immediately starts trying to update a whole bunch of apps instead of just the one I had requested. Since then, two of the apps have been stuck in "Waiting" and are unusable. App store tells me that there are no pending updates and rebooting the phone has no effect. A) is this a known problem, wherein the app store attempts to update apps for which updates were not requested; and B) is there any way to get those apps out of "waiting"?
    Thanks.

    this is not phone or OS problem . its only your router DNS transfer function problem
    I have resolved the problem by myself. I just figured out that the problem due to the DNS transfer function in my router. If I set the iPhone 4S to use the DNS server as 192.168.1.1 which is also the ip address of my router it will have the problem until I set the DNS to some common DNS service, such as 8.8.8.8 from Google. I think it is the problem of compatibiliy between the iOS and the router.
      GOTO SETTINGS>>WI-FI>>click on informatio button(i) of your network>> change DNS to 8.8.8.8>> return
    all the best........

  • IPhone SDK on Tiger

    Ok, last night I downloaded the 2GB free iPhone SDK so I could start developing some small apps for the iPhone and iPod touch. After waiting 30 minutes for the download to complete I was finally ready to start. I double clicked the iPhone SDK icon only to see a very cruel and mean message come up which read the following "Couldn't open iPhone SDK. This package type requires Mac OS X 10.5." Why, in the world would Apple force people who want to develop for THEIR PRODUCTS use a operating system that they don't want to? I have OS X Tiger (10.4.11) and do not have Leopard yet. Is there a version for Tiger available?

    Well, you see, the iPhone SDK is made for Xcode 3. Xcode 3 is only available for Leopard and it would take a very long time for Apple to re-develop it just for Tiger and it wouldn't be worth the effort since most of the developers have all the newest programs installed, including Leopard.
    That's why!

  • IPhone "Remote" App for Apple TV Has Become Sluggish, Slow to Respond

    (Earlier today I posted this question on the "iPhone" section of this thread but perhaps it's more appropriate here.)
    I've searched this and other forums and have yet to see the issue I'm having addressed. After successfully installing and using the iPhone "Remote" app to control my Apple TV, its performance has become erratic. While selecting and/or swiping actions were instantaneous, they're now delayed, sometimes by four or five seconds. My Apple IR remote still works perfectly. Also, the Remote app on my iPhone works fine on the TV set up in various Apple Stores I've visited. A clue that may be relevant is that my RF Dish receiver remote is a bit slow now, too, although not as bad as the WiFi-driven iPhone Remote app. It seems that something in the room is creating these problems (there are no fluorescent lights) and all worked fine months ago. Anyone have any ideas on what might be causing this?

    ok well it seems unlikely that your issue is with the appletv itself.
    could well be wifi interference.
    any cordless phones or cordless doorbells, or any new cars turned up close by with remote car alarms, or a new microwave (or old one starting to fail) ? all this sort of stuff can kill wifi.

  • Mail app does not sync "Sent" or "Read" messages with my iPhone mail app.

    I just started using a new Mac Mini (running 10.9.1). I have the Mail app connected to a handfull of different email addresses, and my iPhone mail app is connected to the same addresses. If I send a message on one device, the other device will not show it. If I read a message on one, the other will not show that I've read it.
    I assume the two Apple devices, both running up-to-date operating systems and using the native Mail app, should be communicating with each other in a way that allows me to work between the two seamlessly. Am I just incorrect in my assumption, is there something I can fix, or is this a bug we're waiting to have repaired?

    Actually, my Gmail is the one that does work appropriately. I have a few IMAP addresses I use that do not sync between devices.

  • Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.

    Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.?

    I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
    What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
    Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
    Thanks again for "anyone" that can help me!!!

  • Looking for something in the iPad/iPhone Airport App

    Hi
    I have been waiting for the airport utility for iPad/iPhone to come as I frequently travel with just my iPad and Airport Express. However, I have been unable to configure it when away from home.
    So, Apple has released a utility but it appears to be the most important feature for being on the road, that is, the ability to switch connection sharing (so you can hook up to a hotel system).
    Is it that I can't find it or it doesn't allow you to do it. In the iPad app, I am looking for the ability to switch between bridge mode and the other two.
    Thanks,
    Andrew

    Tesserex, thanks for the comment . Can you point to where in the utility I cna figure it to
    Share a public IP address
    Distribute a range of IP addresses, or
    Be off in Bridge mode?
    Thanks,I can't work it out.
    Re: Looking for something in the iPad/iPhone Airport App
    created by Tesserax in AirPort - View the full discussion
    The AirPort Utility App that is available with iOS 5 does pretty much everything that the Mac or PC versions do including controlling both the NAT & DHCP services to allow you reconfigure an AirPort as a bridge.

  • Tip: Unable to Install or Update Apps Using the iPhone's App Store?

    I had a problem today where I found myself unable to install updates, or install new or previously purchased apps using the App Store on the iPhone. However, I had no problem with the installation of apps when I plugged my iPhone into my computer, opened iTunes and dragged the app I wanted over to my iPhone. So, I did the usual: I tried a reboot, and, when that didn't work, I powered my phone off and waited a few minutes before turning it back on. Still no love with the updating or installation of apps using the App Store on my iPhone.
    Here is what I did do to fix it:
    I keep backups of my iPhone on my MBP and I back up my phone regularly. If you do not, you should start doing so. Anyway, I went ahead and plugged my phone into my computer and launched iTunes (I also update my MBP daily if necessary, so the most current version of iTunes was used).
    Once my phone showed up in iTunes and I could select it, I right-clicked on the iPhone's name (I use a MBP, but I know Windows users might view this, too, so universal language is what I will use - for Mac users, right-clicking means using two finger tap on a touchpad or using the good 'ol Control-click) and selected "Back Up" from the menu.
    Once the phone was backed up, I right-clicked again on the iPhone's name and selected "Restore from Backup...".
    I made sure the value for "iPhone Name" was correct and that the "Last Backed Up" day and time values were correct and I clicked the "Restore" button and let the restore process finish completely (wait until your iPhone shows up in iTunes again before doing anything else with your phone).
    Once the restore was complete, I was extra cautious and powered off then powered on my phone. Finally, I went ahead and plugged it back into my MBP and made sure that the phone showed up in iTunes.
    Following all of that, I launched the App Store on my iPhone again, entered the password for my Apple ID and updating apps, installing new apps, and installing previously purchased apps from iCloud all worked again.
    Please note that this process is much different than just simply clicking the "Restore" button on your iPhone's homepage in iTunes. That will prompt you to backup your phone, completely restore it to factory defaults, and, then require you to restore from backup to get all your settings and such back. This is not the route I took - I simply restored from an existing backup. I want to make sure that this point is clear. Although, if restoring from an existing backup does not solve the issue at first, then perhaps a restore to factory defaults followed up with a restore from a backup will do the trick, too. I just did not want to waste my time taking the much longer route first and was happy to find my iPhone's App Store working again by simply restoring my phone using an existing backup.
    I have seen a lot of posts regarding this issue in the support communities, with none of them having an answer (even after calling Apple Support). I hope this helps anyone else that has had, is having or will have the same issue! Feel free to post comments regarding other solutions you have found for the same issue - let's have one discussion where all possible solutions can be posted so iPhone users do not have to sort through a bunch of unhelpful discussions just to find a solution that was not yet documented (like I had to).

    See:
    Well known TCP and UDP ports used by Apple software products
    Also see:
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server

  • IPhone SDK 2.2 memory corruption

    Hello. I'm working on an application for iPhone SDK 2.2 and seem to be having weird memory corruption problems. Not necessarily leaks because using Instruments shows my memory stamp never going above about 1.8 megs. The nature of the app is a database of animals so I'm constantly loading and unloading sounds and images. None of the objects are very large (at most I'll have 4 800k pngs loaded at once) and I've checked and rechecked my alloc/retain/release and everything is in order (hence no memory usage increase). However...after using the application for a while I'll notice strange behavior. For example:
    1) we have a UILabel as the title for each page. After a while the font size of this will change.
    2) I have several screens with a subclassed UIScrollView where images are loaded and then added to. The problem shows itself here by the images not showing up. there's no crash, stepping through the debugger shows that the image loads up fine, it's just that the image is not there.
    3) I have a UILabel at the top of an animal description screen, which in the nib file is called "Animal Name" by default. This will change to show "Animal Name" at the top.
    I've removed all audio in our latest build so that isn't the problem. What I'm starting to suspect is that altering anything defined in a nib file will cause corruption. For example, the UIScrollView is defined in the nib file, and I constantly am reassigning the contents of that with a UIImageView. This UIImageView is handled within the subview class like :
    UIImageView *imgView = [[UIImageView alloc] initWithImage: [ UIImage imageWithContentsOfFile:[[NSBundle mainBundle ] pathForResource:imageToLoad ofType:@"png" ]] ];
    imgView.tag = 50;
    [self addSubview:imgView ];
    [ imgView release ];
    Then later when moving away from the screen I'll find that view's tag and remove it from the superview (since addSubView increases the retain count, the alloc+addSubView is cancelled by release+removeFromSuperView)
    I can't explain why titles that are never changed would be affected, but it must somehow be related. What I'm wondering is: are there any known issues involving modification of the contents of objects defined in Nib files? Perhaps the memory allocated when initWithNibName is restrained, then any modification of objects allocated within it can cause corruption. I'm starting to think I should just alloc and free anything modified in code and skip using nib files altogether (I reset the text on buttons for example). If this is a known issue please let me know. I'll give you more information if I can.
    Thank you

    Just download the huge SDK package and install. No need to uninstall the old SDK.

  • Running iPhone SDK & Leopard on G4 1.42 emac?

    Looking for a cheap entry point to get into developing apps for iphone. I can get the 1.42ghz G4 emac for $200 or G5 PPC 2.0ghz for $775.
    I've read that the G4 will run leopard, but havent found anyone running leopard and iphone sdx on the G4. I'd like to try things out first on the G4, but is it going to be so unbearably slow that I'm going to regret taking the cheap way out? Thanks.

    montyplease wrote:
    Looking for a cheap entry point to get into developing apps for iphone. I can get the 1.42ghz G4 emac for $200 or G5 PPC 2.0ghz for $775.
    I've read that the G4 will run leopard, but havent found anyone running leopard and iphone sdx on the G4. I'd like to try things out first on the G4, but is it going to be so unbearably slow that I'm going to regret taking the cheap way out? Thanks.
    Further research has led me believe now that iPhone SDK will only run on Intel based machines. If that is indeed the case, neither machine will work for me.
    <Edited by Moderator>

  • IPhone SDK custom installation, what do I need?

    FYI, I will be developing iPhone Apps only and don't want to install unnecessary things.
    Options are:
    Developer Tools Essentials (Required.)
    iPhone SDK (Obviously need.)
    System Tools (Do I need? It's checked by default.)
    UNIX Development Support (Do I need? It's checked by default.)
    Mac OS X 10.3.9 Support (Know I don't need, not developing anything for OS X, particularly not an old version.)
    WebObjects (Do I need? It's NOT checked by default.)
    Thanks.

    Hi--
    Welcome to the Apple Discussions.
    System Tools (Do I need? It's checked by default.)
    I would suggest "yes." That's the installer for the performance tools. Shark, especially, can be invaluable for profiling your code.
    UNIX Development Support (Do I need? It's checked by default.)
    I'd suggest "yes." It's command line tools you might want at some point (to help in automating builds, etc.). Some aspects of scripting with OS X can also be made easier if you have the UNIX dev support installed.
    WebObjects (Do I need? It's NOT checked by default.)
    Definitely not, that's a web application framework you'd use if you were building a web site.
    charlie

  • IPhone SDK on PPC

    Hi,
    I am fully aware that the iPhone SDK is NOT supported on PowerPC based macs.
    I have read several tutorials on how to make it work (including http://3by9.com/85/), but I have found something quite annoying.
    All of the tutorials refer to a package named "Aspen Simulator", but it is NOT in my "Packages" folder of the SDK I downloaded. Also, tutorials say the install is about 5 gig, mine was four gig.
    My best guess is that the tutorials were made for the beta versions of the iPhone SDK.
    How can I develop iPhone Apps on a PPC based mac? I do NOT want to put them on the App Store, I am just eager to experiment.
    Thank you.

    Thanks! I managed to get the simulator running!
    Just need to clarify one last thing:
    To test on my iTouch, I need to pay the $99 fee right?

  • My reset/sleep button on my iPhone 4 has just stopped working, how can I fix this??

    My reset/sleep button on my iPhone 4 has just stopped working , how can I fix this??

    Hi Hamish1P,
    Thanks for using Apple Support Communities. Based on what you stated, it sounds like an app you installed is not working. I would recommend that you read this article, it may be able to help the issue.
    If an app you installed unexpectedly quits, stops responding, or won’t open - Apple Support
    Cheers,
    Mario

Maybe you are looking for

  • Missing A single HD TV Episode

    I bought Season 2 of "Chuck" using the AppleTV, and was enjoying the final few episodes. I realized that the very last episode did not download. It downloaded in iTunes just fine in SD, but when I click check for downloads in iTunes and on the AppleT

  • Regarding problem in posting date after opening new year

    Hi SAP Gururs, I have just opened the new fiscal year thrugh OB52 and also made a new number range by copying the previuos year number range thrugh OBH2. Now when i m posting the entries for G/l, Customer & vendors, everything is going fine but vendo

  • How to confiure the fields displayed in F4 help hit list?

    Hi Gurus, I got a strange issue. Standard F4 help in PA20 displays a hit list of employees along with the details like name of the employee, his personnel number, his date of Birth and other details. Now the customer requirement is as follows - The b

  • I use shockwave flash in a platform for my work and every day it seizes up.  I have to reboot the p.c. and reload the platform.  Help !!!

    I utilize a trading platform for my work on a daily basis.  They use shockwave flash in this platform.  Every day it slows and then seizes up everything.  I have to reboot my p.c. manually and then reload the platform.  I have had my p.c. checked, ta

  • J1IEX - Screen

    Dear All, In J1IEX screen, my client want SCESS field of Credit Available part as editable field in the Detail Data section (below of Item section). Right now SCESS field is in display mode, then all other fields like BED, AED, NCCD, SED and ECS fiel