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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:03:47+00:00 2026-06-13T18:03:47+00:00

In my game players will be able to plant a tree, which will take

  • 0

In my game players will be able to plant a tree, which will take 3 hours to grow. When the player logs back in how would I calculate whether that tree is now fully grown? the creation date of the tree (planted) will be stored on a server, and I will be storing the 3 hours in seconds (not sure if that should be an int of NSNumber) also on the server.

Thanks for any help.

  • 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-13T18:03:48+00:00Added an answer on June 13, 2026 at 6:03 pm

    Get your creation date back from the server as an NSDate, and use timeIntervalSinceDate: like so:

    NSDate *now = [NSDate date];
    NSTimeInterval secondsSincePlanting = [now timeIntervalSinceDate:plantingDate];
    if (secondsSincePlanting > secondsRequiredForTreeToFullyGrow) {
       ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm designing game site where many (hopefully thousands) players will simultenaously play certain card
I am building a massively multiplayer game with Node.js and Socket.io. All players will
I'm working on a game where multiple players should be able to play at
I'm making an Online game where I will host a game server. Players will
I'm writing a game in C using the Gtk libraries, in which the player
I'm currently working on a game whereby I will have a player traversing a
In this game im trying to create, players are going to be able to
I'm making a iOS game which will pick a random clue(text) and image (clue
I'm developing a programming game where players will have access to an abstract class
I'm designing a game where players are programmed bots competing in a programming contest.

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.