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

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

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

你可能感兴趣的文章
Centos 7.5 部署DNS
查看>>
yum简介
查看>>
cp讲解
查看>>
MariaDB Galera Cluster 部署(如何快速部署MariaDB集群)
查看>>
如何在 Swift 语言下使用 iOS Charts API 制作漂亮图表?
查看>>
论代码审查的重要性
查看>>
「docker实战篇」python的docker爬虫技术-导学(一)
查看>>
linux日志基础介绍
查看>>
如何关闭SElinux
查看>>
处理器之MMU(三)
查看>>
172.16.82.0/25的含义,IP段,掩码
查看>>
测试之路
查看>>
终于对了
查看>>
RabbitMQ集群
查看>>
Apache防盗链和隐藏版本信息
查看>>
ARP协议与路由
查看>>
SCI检索介绍
查看>>
Android开发之生成自己的签名文件及App签名打包
查看>>
如何提高阿里云上应用的可用性(二)
查看>>
云宏WinCloud前端工程师告诉你什么是UI扁平化
查看>>