5-ios_OCBasic-2

1.anonymous obj

scene: we just invoke a obj's method once

2.self

self in oc ~ this in Java

a subject in a obj method A which is ahead of "self" invoke method B

the self here is a obj who invokes method

so as in a class method:

we invoke a class method A in class method B,we add self when we do

3.override

class A : class B

how to rewirite a method in class A,don't declare ,just write a method with a same name.

4.extends

we invoke a method in A class, we look for it in the Father classes one by one,until the NSObjectw.

we can not only use the member_vars  & obj methods in Father calss,but also the Class method

we can also rewrite the class method

we can't call the member_vars which is tagged private

5.private, protected,public

the same as in Java except @package

6.SPECIAL

we usualy create a var in .h file

but if we create a var in .m file,it is default private

7.polymorphic

polymorphic in oc ~ polymorphic in Java

the Father Indicator -->  Son Indicator

8.description

%@  will rewrite the description method

-----------before Xcode 4.4-----------

9.@property

in android,right click and build the getter/setter method

in oc,we use @property in Interface

10.@synthesize

@synthesize in Implements

synthesize var = _var

if we just write synthesize var, it will create a member_var automatically

-----------before Xcode 4.4-----------

11.@property

we write @property in Interface,and we can also cover the method in Implements

but we should add (nonatomic)

if u cover the setter & getter method at the same time,u have to create a member_var yourself

@property (readonly):remain the getter one method

12.id

a universal indicator

13.private mehtod

if we write a method in .m,don't declare it in .h,it is private method

Sum:

Null

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值