gpt4 book ai didi

ios - 为什么 UIApplicationMain 函数被命名为类命名风格

转载 作者:行者123 更新时间:2023-11-28 15:21:57 25 4
gpt4 key购买 nike

当我第一次看到 UIApplicationMain我以为是一个类(class),因为名字的首字母是大写的。而在阅读文档时发现它是一个函数。 Apple 必须以类命名风格命名 UIApplicationMain 函数的任何特殊原因?

最佳答案

来自 Naming Functions在里面“Cocoa 编码指南”(重点添加):

Function names are formed like method names, but with a couple exceptions:

  • They start with the same prefix that you use for classes and constants.
  • The first letter of the word after the prefix is capitalised.

这里,UI 是 UIKit 框架的前缀。

关于ios - 为什么 UIApplicationMain 函数被命名为类命名风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45836150/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com