How to use compare on a version number where theres less parts in one number in Objective-C?

前端 未结 9 712
感情败类
感情败类 2021-01-22 02:30

I\'ve found the following code at http://snipplr.com/view/2771

Which is pretty good, almost exactly what I was looking for, but if I use the values @\"1.4.5\", @

9条回答
  •  野性不改
    2021-01-22 02:47

    You can use my Version class that helps you to parse your version strings into Version objects for easy compare. It supports 4 field version numbers like major.minor.release.build, all fields are optional. Also, it has a compare method for comapring two version objects.

    https://github.com/polatolu/version-ios

提交回复
热议问题