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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:30:43+00:00 2026-05-14T15:30:43+00:00

We’re distributing a Cocoa framework with regular updates. We’ll be updating the version numbers

  • 0

We’re distributing a Cocoa framework with regular updates. We’ll be updating the version numbers with each release. The Apple documentation appears to suggest that version numbers should be consecutive incrementing integers. We are distributing output in several formats, and the framework is only one of them. We would rather not have to maintain a separate numbering system just for our frameworks.

We don’t really care about the precise format of the version numbers of the framework, so long as they change whenever the product changes, and behave in a correct, sensible and expected manner. I’m looking for a way of avoiding having to run a separate version number counter.

One suggestion is that for product version 12.34.56 we could simply remove the dots and say the framework version is 123456 (with appropriate zero padding).

  • Is there a constraint on the type of number that can be represented (uint? long?)
  • Does it have to be a number? Could it be a string?
  • Do the numbers have to be consecutive?
  • Is there a standard way of doing things in this situation?
  • 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-14T15:30:44+00:00Added an answer on May 14, 2026 at 3:30 pm

    As I understand it, the reason for this requirement is so that you can have macro checks like:

    #if FRAMEWORKNAME_VERSION >= 123456
        // some stuff
    #else
        // some other stuff
    #endif
    

    The numbers do not need to be consecutive, and your suggested scheme is quite sensible:

    #define MAKE_VERSION(MAJOR,MINOR,PATCH) ((MAJOR*10000)+(MINOR*100)+PATCH)
    

    I would also suggest that in addition to defining a version, you also define constants for each version…

    #define FRAMEWORKNAME_VERSION_1_0_0 MAKE_VERSION(1,0,0)
    #define FRAMEWORKNAME_VERSION_1_0_1 MAKE_VERSION(1,0,1)
    

    That way, you can check in multiple ways… either:

    #if FRAMEWORKNAME_VERSION >= MAKE_VERSION(1,0,1)
        // 1.0.1 and later
    #else
        // Before 1.0.1
    #endif
    

    Or:

    #if defined(FRAMEWORKNAME_VERSION_1_0_1)
        // 1.0.1 and later
    #else
        // Before 1.0.1
    #endif
    

    The key requirements that you should satisfy are:

    • The numbers are monotonically increasing
    • The numbers are predictable
    • The numbers are easily comparable

    If you want to supply a string representation of your version in addition to the integer representation, by all means go ahead; however, I would strongly suggest that you have an integer representation available, as it simplifies comparison and allows the version to be checked in the preprocessor.

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

Sidebar

Ask A Question

Stats

  • Questions 372k
  • Answers 372k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You may refer to a earlier question. [NSUserDefaults standardUserDefaults] is… May 14, 2026 at 7:18 pm
  • Editorial Team
    Editorial Team added an answer Use lua_pushlstring. void lua_pushlstring (lua_State *L, const char *s, size_t… May 14, 2026 at 7:18 pm
  • Editorial Team
    Editorial Team added an answer How much CPU time and memory does it take to… May 14, 2026 at 7:18 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.