开发者

iPhone SDK static library versioning

I've been writing iOS apps for some time now and for this particular project, I decided that I needed a static library for code sharing purposes.

I've followed some tutorials in creating static libraries and everything works 开发者_StackOverflow社区perfectly.

Now I wonder, is there any way of versioning the static library?

I couldn't find any files regarding version number in the static library project, nor any good search results (both Google and here) regarding this particular issue.

I think I could create some kind of "fake" Info.plist and store the version info there.

Is that the way of doing it? Any other approaches to the problem?

Edit:

I think I may have not been clear on my purpose:

I have a workspace that has both my library project and related projects using the library, which is imported using the .xcodeproj file, then configured the dependencies so it builds whenever needed.

I just need some way of versioning the library, so that I can include that in some sort of about box, just in case.


I think you should stay away from bundling binary builds of your own code. Unless you're building a really, really, really massive library, you're better off just importing the code in any of your projects, and rebuilding it each time. You can put it in a separate target though, so Xcode doesn't rebuild it all the time.


You might want to write a tool that takes version info in a .plist and writes it out as literal strings defined in a .h file, which you can then include in your own code.

To make it foolproof (avoid mismatch between the header and the library), define a class method like [YourLibraryClass versionString] that returns a NSString with the version number or signature.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜