-2

I am trying to teach myself objective-C and I'm running to all these terms that are unfamiliar like mutable and atomic. I've been googling for this for a while now and can't seem to find a page that has a bunch of definitions all in one place. Does anyone have a link to a page that has table/cheatsheet with common objective-C terms and definitions. Also, a page that translates objective -C terms to java terms would be really helpful too. Thanks :]

4

1 回答 1

3

我自己对objective-c很陌生,但这里有一些基本术语我花了一段时间才理解。大多数书籍往往使他们的角色或目的过于复杂,给学习者造成歧义。

  • mutable:“可变的”,可以改变,而不是“不可变的”。
  • 接收者:接收消息的对象
  • 消息:一种方法
  • instance:在需要时调用,与在运行时编译的变量/方法相反
  • atomic,nonatomic:处理代码中的某些元素如何处理内存,例如属性。据我所知,初学者并不需要担心这些,因为很多内存管理都是由 Objective-c 的 ARC(自动引用计数)处理的。如果您有兴趣阅读更多内容,我找到了一个 SO线程。

  • 接口:通常用“.h”文件扩展名表示,是类的一部分,它定义了该类的对象可以访问的方法和实例变量。此外,这里设置了属性。

  • 实现:通常用“.m”文件扩展名表示,是类的一部分,详细说明了接口中定义的函数和属性的作用。

希望这有帮助。再说一次,我对此也很陌生,所以兽医们,随时纠正任何信息,因为这来自我的脑海。~地毯嘶嘶声

于 2013-05-06T06:22:56.610 回答