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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:46:23+00:00 2026-05-29T10:46:23+00:00

I need some advice about how to logically proceed to limit the use of

  • 0

I need some advice about how to logically proceed to limit the use of an app, I mean, as Shazam does: you can use it only for some times during a month, then you have to wait until next month for use it again. I’m doing it with Xcode and objective c.

How can I understand if the month is changed?

  • 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-29T10:46:24+00:00Added an answer on May 29, 2026 at 10:46 am

    From a logical point of view, a basic method can be:

    use a structure like:

    struct run_time_for_month {
        int month;
        int minutes_left;
    } 
    

    and save in some option file (maybe with 0 as default).

    when the application start, load the structure, then check the month. If it is 0, then is the first run, so set

    month = current_month
    minutes_left = 100 (for example)
    

    and write it to the file.

    If the month is greater than 0, then you use this code (I write some pseudo code here)

    if current_month == saved_month then
        if minutes_left <= 0 then
             *** Running time for month ended ***
             *** Notify the user and exit the app ***
    else
        saved_month = current_month
        minutes_left = 100
    

    and save the file

    Now, while the application is running, every x minutes (with x = 5 or 10) and when the application is quitting you use this code (again, pseudo code here)

    minutes_left = minutes_left - x
    if minutes_left <= 0 then
         *** Time for month ended ***
         *** Notify the user and exit the app ***
    

    this a stripped down version of what I do in my code when I needed something like that, but again: I am not working with XCode and/or Objective C but with C++ so this can be only an idea.

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

Sidebar

Related Questions

I need some advice about the design on my app. I have several screens
I need some advice as to how I easily can separate test runs for
I need some advice on what kind of pattern(s) I should use for pushing/pulling
please I need some advice about design approaches in iPhone programming. I want to
I need some advice in tackling a query. I can handle this in a
I need some advice on how to go about a particular issue I'm trying
Ok, so I need some advice on which encryption method I should use for
I just need some advice about using tags. I'm working on a website right
i'm really confused about something and need some advice. i want to be able
I need some advice here, I hope somebody can help me. I have the

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.