id NSObject instanceType 区别
2016-01-07 13:46
453 查看
id 当不确定数组元素类型时,可以选择使用id
NSObject和id都可以指向任何对象
NSObject使用时必须强转
instantceType 只能返回和方法所在类相同类型的对象 返回值类型 不能传参数
id只能返回未知类型的对象 参数使用
NSObject和id都可以指向任何对象
NSObject使用时必须强转
instantceType 只能返回和方法所在类相同类型的对象 返回值类型 不能传参数
id只能返回未知类型的对象 参数使用
相关文章推荐
- object-c 子类覆盖父类属性 详解
- Objective-C点语法
- IOS object-c 中定时器NSTimer的开启与关闭
- Objective-C点语法
- Git CMD - tag: Create, list, delete or verify a tag object signed with GPG
- objective-c -- nil / Nil / NULL / NSNull
- -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (xx)
- VS2008 ActiveX IObjectSavety IExpress打包cab,发布
- objective-c高德地图时时定位
- SetValue:forKey和SetObject:forKey的区别
- Object-C 切换到 Swift 全程直播
- Objective-C中的SEL、IMP和Class类型
- Objective C类方法load和initialize的区别
- C++11的future和promise及active object并发模式
- Objective-C中的实例方法、类方法、Category、Protocol
- URL-encoded form data is not valid ,Operation is not valid due to the current state of the object
- 多线程学习笔记
- Ruby基础语法(1): Object
- Guava学习笔记(3):复写的Object常用方法
- 【Objective-C学习记录】第三十六天