具有高质量代码的开源 Objective-C 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1067529/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Open source Objective-C projects with high quality code?
提问by alanlcode
I think one of the best ways to learn a new programming language is to dive into source code and see how experienced coders write. I've found this kind of question asked here on Stack Overflow for other languages, but none targeted at Objective-C. The closest I've found is this question about good-looking Cocoa user interfaces, but I'm thinking in terms of general code quality, such as good use of idioms and design patterns, and usable documentation. Another good characteristic would be a code-base that is large enough to require real organizational discipline, but small enough that a beginner can fit his/her head around.
我认为学习一门新的编程语言的最好方法之一就是深入研究源代码,看看有经验的程序员是如何编写的。我在 Stack Overflow 上发现了针对其他语言的此类问题,但没有一个针对 Objective-C。我发现的最接近的是这个关于好看的 Cocoa 用户界面的问题,但我正在考虑一般代码质量,例如良好使用习惯用法和设计模式以及可用文档。另一个好的特性是代码库足够大,需要真正的组织纪律,但又足够小,初学者可以适应他/她的头脑。
What do you think is a high-quality open source project that meets these criteria?
您认为符合这些标准的高质量开源项目是什么?
采纳答案by mipadi
回答by Dave DeLong
There's a decent list of open source Mac projects on CocoaDev: http://cocoadev.com/CocoaOpen
CocoaDev 上有一个不错的开源 Mac 项目列表:http://cocoadev.com/CocoaOpen
Not all of the projects are still active, but a decent number of them are. I particularly recommend:
并非所有项目都仍然活跃,但其中有相当多的项目处于活跃状态。我特别推荐:
- BWToolkit - http://bitbucket.org/bwalkin/bwtoolkit/
- BGHUDAppKit - http://www.binarymethod.com/bghudappkit/
- CHDataStructures - http://cocoaheads.byu.edu/code/CHDataStructures
- MGTwitterEngine - http://mattgemmell.com/source
- Sparkle - http://code.google.com/p/sparkleplus/
- Colloquy - http://colloquy.info/project/wiki/Source%20Code
- CocoaRest - http://github.com/sdegutis/CocoaREST
- CorePlot - http://code.google.com/p/core-plot/
- BWToolkit - http://bitbucket.org/bwalkin/bwtoolkit/
- BGHUDAppKit - http://www.binarymethod.com/bghudappkit/
- CHDataStructures - http://cocoaheads.byu.edu/code/CHDataStructures
- MGTwitterEngine - http://mattgemmell.com/source
- 闪闪发光 - http://code.google.com/p/sparkleplus/
- 口语 - http://colloquy.info/project/wiki/Source%20Code
- CocoaRest - http://github.com/sdegutis/CocoaREST
- CorePlot - http://code.google.com/p/core-plot/
回答by Quinn Taylor
I don't think there's any one place to learn all the Objective-C idioms and best practices, but you can pick them up here and there over time and practice. Cocoa mailing lists and blogs are good resources for this. (There are several SO questions relating to that.)
我认为没有任何地方可以学习所有的 Objective-C 习语和最佳实践,但是随着时间的推移,您可以在这里和那里学习和练习。Cocoa 邮件列表和博客是很好的资源。(有几个与此相关的 SO 问题。)
I haven't dived into the source myself, but the Omni frameworksare well-respected in the Mac community.
我自己没有深入研究源代码,但Omni 框架在 Mac 社区中备受推崇。
I work on a framework of my ownthat's still rough around the edges, but I strive for quality documentation in addition to understandable, well-structured code.
回答by f3lix
Google Quick Search Box[ qsb-mac - Google Code]
Google 快速搜索框[ qsb-mac - Google 代码]
I think The Google Quick Search Box (QSB) is worth a look. IMHO it's pretty much a cleaner googley rewrite of Quicksilver (Note:N. Jitkoff, the QS programmer, is also involved in the Google QSB).
我认为 Google 快速搜索框 (QSB) 值得一看。恕我直言,它几乎是对 Quicksilver 的更清洁的谷歌重写(注意:QS 程序员 N. Jitkoff 也参与了 Google QSB)。
回答by z5h
Apple has tons of downloadable examples on their developer website. You get to see the source, and the license is BSDish from what I recall (use it for whatever, but don't repost original code without the license).
Apple 在其开发者网站上提供了大量可下载的示例。你可以看到源代码,并且我记得许可证是 BSDish(将它用于任何目的,但不要在没有许可证的情况下重新发布原始代码)。
回答by Amit
Check Out lots off open source project here.
在此处查看大量开源项目。
回答by Amit
I used to work on the GNUstep sources, they've got a good consistent coding style and the code is well-organised. Of course the project is hardly small, but given that you know what most of the classes do as you've used them in your Cocoa projects it's easy to zoom in on a piece that interests you. Some of the GNUstep Applications Project or étoilé apps may also be a good place to start.
我曾经在 GNUstep 源代码上工作,它们具有良好一致的编码风格,并且代码组织良好。当然,该项目并不小,但是鉴于您在 Cocoa 项目中使用过这些类时,您知道大多数类的用途,因此很容易放大您感兴趣的部分。一些 GNUstep Applications Project 或 étoilé 应用程序也可能是一个不错的起点。
回答by Peter Hosey
Here's a test app I wrote earlier today. Download links under “get source” in the top-right.
这是我今天早些时候编写的一个测试应用程序。在右上角的“获取源”下下载链接。
It's small, but it demonstrates good organizational discipline (separate controller object, instead of everything crammed into AppDelegate), a simple model layer with one model class (Header), and correct use of Cocoa Bindings.
它很小,但它展示了良好的组织纪律(单独的控制器对象,而不是塞进 AppDelegate 的所有东西)、一个带有一个模型类(Header)的简单模型层,以及 Cocoa Bindings 的正确使用。
回答by Preston Software
Check out PSTreeGraph, a view control for iPad applications.
查看PSTreeGraph,这是 iPad 应用程序的视图控件。
回答by lulu
iMedia Browser, shows support of 10.4 - 10.7 strategies, is neatly and purposefully organized, and deeply commented. inherent problems using ImageKit have been boldly approached and solved.
iMedia 浏览器,显示支持 10.4 - 10.7 策略,整齐而有目的的组织,并有深刻的评论。使用 ImageKit 的固有问题已被大胆地接近和解决。
i aspire to this level of thought mixed with practicality.
我渴望这种水平的思想与实用性相结合。

