IOS Tutorial -- 1) Objective-C Basics

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

 

 

转载于:https://www.cnblogs.com/davidgu/archive/2013/06/09/3129589.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值