博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IOS Tutorial -- 1) Objective-C Basics
阅读量:7117 次
发布时间:2019-06-28

本文共 2073 字,大约阅读时间需要 6 分钟。

Objects and classes

A class consists primarily of two things: variables that can store data and methods
that can perform operations.

Subclasses

Classes can also inherit functionality from an existing class

Instance and class variables

Changing the value of an instance variable in one object

will not affect the value of the same variable in all the other objects of that class.
Conversely, only a single copy of a class variable exists. If you change the value of
a class variable from one object, the value of that variable will change for all the
objects of that class

Accessor methods

Accessor methods, sometimes called getters and setters, are usually fairly simple
methods used to get and set instance variables in a class

Class methods

Class methods (also known as static methods) are  methods that are associated directly

with the class rather than the object instance

Events and messages

An event is a message generated by the user interacting with your application’s
controls. For instance, if you tap the screen of your iOS device, this generates a UI
event in your application that is passed via a message from the application to an
object that has been delegated to deal with that specific type of event

Protocols

A protocol definition declares methods that any class can implement. If your class
declares that it abides by a particular protocol definition, you are announcing that
you have implemented the minimum mandatory methods declared in the protocol
definition, and may optionally have implemented some nonmandatory methods

Delegate classes

A delegate class is a class that implements a protocol for handling events.

Event loop

The main event loop is the principal control loop for your application.

Reference Counting

Reference counting is a form of garbage collection, which counts the number of references

to an object (or portion of memory) and frees the associated memory when the
number of references reaches zero. The main advantage of reference counting over
"classic" garbage collection is that memory is freed as soon as it is no longer in use

 

 

转载地址:http://xofel.baihongyu.com/

你可能感兴趣的文章
Linux中管理用户和组命令
查看>>
将本地docker容器迁移到服务端
查看>>
甲骨文匯編1
查看>>
从0打卡leetcode之day 6--最长回文串
查看>>
使用python创建跨平台的fork()炸弹
查看>>
CentOS 6.5下rsync服务器安装配置
查看>>
Trapping Rain Water@LeetCode
查看>>
SSM-SpringMVC-03:SpringMVC执行流程一张有意思的图
查看>>
愚人节老板发话了,免费送书 + 免费入驻Java知识星球!!
查看>>
题解 P2350 【[HAOI2012]外星人】
查看>>
[20180423]关于闪回表与主外键约束.txt
查看>>
新经资讯项目业务逻辑梳理
查看>>
JDK1.8源码(五)——java.util.ArrayList 类
查看>>
Android - SharedPreferences
查看>>
Deepin 操作系统联合创始人宣布离职
查看>>
系统思考的定义
查看>>
forEach遍历数组对象且去重
查看>>
逸鹏说道:读王阳明、曾国藩有所感
查看>>
5月19-20日WebRTCon 2018 梳理全球WebRTC技术实践与案例
查看>>
Redux源码分析之基本概念
查看>>