SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict Jakob's Avatar
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iOS timeout question

    I'm building a puzzle game app for iPhone. The user have to solve the puzzle on time.

    If the user leaves the game (turning of the phone or pushing the big menu button) I would like to clock to keep counting down. Is that possible or would the timer just be paused along with the rest of the game?

    Thanks :-)
    Learn more about Solar Panel Installation

  2. #2
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,338
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You should ask iOS questions on the iOS Developer's Forum. You'll get very insightful answers there.

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,625
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    iOS has some pretty tight controls on what you can do when your app is not in the foreground as they prefer user battery life over developer convenience. Perhaps a better way to handle this would be to capture the "go to sleep" event and record the timestamp. Then capture the wake event and look for captured timestamp and compare. Basically faking the countdown that you could have had that nobody could see anyhow.

  4. #4
    SitePoint Addict Jakob's Avatar
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you both very much for answering. Very usefull - and I will for sure check out the iOS Developer's Forum.
    Learn more about Solar Panel Installation

  5. #5
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,873
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    As wwb said, that is your best option, as once the app leaves the foreground, there is a limited amount of time you have to process any last async code, but it gets paused


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •