有什么方法可以不向用户显示我用来在用户计算机上创建静态库的类吗?
我想开发一个 Mac 应用程序,代表用户为 iPhone 构建自定义静态库。
我知道我可以使用 -xcodebuild 从终端调用 xcode 在用户计算机上构建这些静态库,但我的问题是我不想向用户显示我使用的 Objective-C 类对于静态库。
所以我的问题是有什么办法不向用户显示我的课程吗?除了使用 -xcodebuild 我还有其他方法吗?
提前致谢
I'd like to develop a Mac application that builds custom static libraries for iPhone on behalf of the user.
I know that I can invoke xcode from the terminal with -xcodebuild to build these static libraries on the user machine, but my problem is that I don't want show to the user my objective-c classes used for the static library.
So my question is there any way to not show to the user my classes? Instead of use -xcodebuild I have other some way?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜你想阻止你的库的用户看到你的静态库的头文件,对吧?我想这确实是有问题的,因为编译器需要头文件才能正确编译。
您可以做的是向班级用户提供标头的“精简”版本。
我不久前偶然发现了这个教程。如果您想让类的代码对任何应该使用它的开发人员“封闭”,我建议将其设为静态库。或者,您可以制作一个框架。
http://www.clintharris.net/2009/iphone-app-shared-库/
不用担心,这对于 iOS 和 Mac OS X 来说是相同的过程。
I guess you want to prevent the users of your library to see the header files of your static lib, right? I guess this is really problematic, as a compiler requires the header files to compile properly.
What you can do is to provide a "stripped down" version of your headers to your class users.
I stumbled across this tutorial a while ago. If you want to keep the code of your classes "closed" to any developers who are supposed to use it, I suggest making it a static library. Alternatively you can make a Framework.
http://www.clintharris.net/2009/iphone-app-shared-libraries/
No worries, this is the same process for iOS and Mac OS X.
简而言之,不需要。由于您的代码将由 gcc 为机器编译,因此用户只需在适当的时刻拦截 Gcc 并读出代码即可。
您可以通过将代码从应用程序直接传输到 gcc 来使拦截变得更加困难(但并非不可能),并进行一些检查以验证它是否确实是 gcc。
您还可以将所有用户通用的一些代码预编译到框架中,这意味着您不需要将源代码分发到该部分。
In short, No. Since your code will be compiled for the machine by gcc, the user need only intercept Gcc at the appropriate moment and read out the code.
You can make this more difficult (but not impossible) to intercept by piping the code directly into gcc from your application, and do some checks to validate that it's really gcc it's going to.
You can also precompile some of the code that is common to all users into a framework, and that means you don't need to distribute the source to that part.