`
445822357
  • 浏览: 739819 次
文章分类
社区版块
存档分类
最新评论

Cocoa的编码规范

 
阅读更多

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命名规范和推荐框架编程实践两方面的内容。

这篇文章的组织结构

这篇文章包含了包含了两个普通类型的内容。第一部分是也是最大的篇幅来介绍编程接口的命名规范。苹果自己也在使用这些规范来编写Cocoa的框架。命名规范包含一下几篇文章:
“ 代码命名基础”
“函数命名”
“方法命名”
“属性和数据类型命名”
“可接受的缩略词缩写”
第二部分会讨论框架编程部分
“框架开发者的开发注意事项以及相关技术”
分享到:
评论

相关推荐

    苹果Cocoa编码规范(中文版)

    苹果Cocoa编码规范的中文版,iOS开发者,可以参考

    苹果 Cocoa 编码规范中文版

    苹果 Cocoa 编码规范 中文版

    苹果 Cocoa 编码规范(中文版)

    在面向对象软件库的设计过程中,开发人员经常忽视对类,方法,函数,常量以及其他编程接口元素的命 名。本节讨论大多数 Cocoa 接口的一些命名约定。

    Cocoa编码规范

    苹果 Cocoa 编码规范(中文版),Google Objective-C Sytle Guide(中文版)

    苹果_Cocoa_编码规范(中文版)

    苹果_Cocoa_编码规范(中文版)

    iOS 编码规范

    iOS 编码规范 参考官方资料总结而成。写一手最规范、最优雅的代码。 参考资料: Apple: Coding Guidelines for Cocoa Google: Objective-C Style Guide Three20: Source code style guildelines

    资料库

    根据Cocoa编码规范里的描述,命名应该遵循以下基本原则:清晰,一致,没有自我参照,即清晰性,一致性,不要自我指涉。 2.1通用命名规范 通用命名规则适用于类名,变量,常量,属性,参数,方法,函数等。(重名除外...

    纽约时报 移动团队 Objective-C 规范指南

    Cocoa 编码指南 iOS 应用编程指南 目录 点语法 间距 条件判断 三目运算符 错误处理 方法 变量 命名 注释 Init 和 Dealloc 字面量 CGRect 函数 常量 枚举类型 位掩码 私有属性 图片命名 布尔 单例 导入 Xcode 工程 点...

    Daniel's Objective-C Coding Style Guidelines

    详情参考:http://desheng.me 参考Apple Coding Guidelines for Cocoa, Google Objective-C Style Guide,Three20 Source Code Style Guildelines总结的Objective-C编码规范

Global site tag (gtag.js) - Google Analytics