Introduction to Coding Guidelines for Cocoa
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html#//apple_ref/doc/uid/10000146-SW1
Developing aCocoaframework, plug-in, or other executable with a public API requires some approaches and conventions that are different from those used in application development. The primary clients of your product are developers, and it is important that they are not mystified by your programmatic interface. This is where API naming conventions come in handy, for they help you to make your interfaces consistent and clear. There are also programming techniques that are special to—or of greater importance with—frameworks, such as versioning, binary compatibility, error-handling, andmemory management. This topic includes information on both Cocoa naming conventions and recommended programming practices for frameworks.
Organization of This Document
The articles contained in this topic fall into two general types. The first and larger group presents namingconventionsfor programmatic interfaces. These are the same conventions (with some minor exceptions) that Apple uses for its own Cocoa frameworks. These articles on naming conventions include the following:
The second group (currently with a membership of one) discusses aspects of framework programming:
Cocoa的编程规范介绍
开发一个Cocoa framework,插件,或者利用公共API编写的其他的可执行程序,需要一些approaches和一些不同于应用开发的规范。这些规范主要是用于产品开发者,这些的接口规范需要很清晰,以免他们会感到迷惑。这就是这篇文档想要做的事情,它能帮助你来让你的接口保持一致和清晰。也有许多编程技术对于框架的开发具有特殊性和重要性,比如版本管理,二进制兼容性,错误处理以及内存管理等。这篇文章包含了Cocoa命名规范和推荐框架编程实践两方面的内容。