iOS.ObjC.Basic-Knowledge
1. ObjC的基础
2. ObjC2.0中的编译指令
3. ObjC Runtime
4. ObjC Object Model
5. ObjC的新语法
6. FQA
1. ObjC的基础
2. ObjC2.0中的编译指令
http://www.learn-cocos2d.com/2011/10/complete-list-objectivec-20-compiler-directives/
http://developer.apple.com/library/mac/#releasenotes/Cocoa/RN-ObjectiveC/index.html
3. ObjC Runtime
3.1 class method 中的self 和 instance method中的self不同点在哪?
Within the body of a class method, self refers to the class object itself.
参见: https://developer.apple.com/library/ios/documentation/general/conceptual/DevPedia-CocoaCore/ClassMethod.html
3.2 metaclass
http://www.cocoawithlove.com/2010/01/what-is-meta-class-in-objective-c.html
Class and metaclass:
http://www.sealiesoftware.com/blog/archive/2009/04/14/objc_explain_Classes_and_metaclasses.html
http://resources.infosecinstitute.com/ios-application-security-part-3-understanding-the-objective-c-runtime/
4. ObjC的新语法
4.1 属性只需要声明(使用property指令), 而不需要@synthesize指令,那么会发生什么?
@interface Context : NSObject
@property (nonatomic, strong) NSMutableString *text;
4.2 @import
例如:
@import UIKit
4.X Modern Objective-C: WWDC 2012 Session 405 (TODO)
5. QA
5.1 NSCopying NSMutableCopying
Implement "- (id)copyWithZone:(NSZone *)zone" for immutalbe object.
ARC:
- (id) copyWithZone:(NSZone *)zone { return self; }
MRC:
-(id) copyWithZone:(NSZone*)zone { return[self retain]; }
- (id)mutableCopyWithZone:(NSZone *)zone
Ref:
A. POP, POPAnimatableProperty类
B. http://stackoverflow.com/questions/9127198/objective-c-immutable-object-copywithzone-arc-compatible-realization
5.2
NS_RETURNS_RETAINED
NS_RETURNS_NOT_RETAINED
CF_RETURNS_RETAINED
CF_RETURNS_NOT_RETAINED
NS_RELEASES_ARGUMENT
CF_RELEASES_ARGUMENT
Ref
A. http://clang-analyzer.llvm.org/annotations.html
B. http://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-object-operands-retained-return-values
5.3
NSObject的接口
"+ (id)allocWithZone:(struct _NSZone *)zone" 在子类该如何实现呢,该接口在ObjC中是什么作用?
iOS.ObjC.Basic-Knowledge的更多相关文章
- iOS进行Basic认证与NTLM认证
一.iOS进行Basic认证 只需要在NSMutableURLRequest的Header中添加认证所需的Username和password. NSMutableURLRequest *webReq ...
- NLP related basic knowledge with deep learning methods
NLP related basic knowledge with deep learning methods 2017-06-22 First things first >>> ...
- Python基础知识(Basic knowledge)
Python基础知识(Basic knowledge) 1.认识Python&基础环境搭建 2.Python基础(上) 3.Python基础(中) 4.Python基础(下) 5.Python ...
- iOS.ObjC.Compiler.Directives
Objective-C Compiler Directives @dynamic "You use the @dynamic keyword to tell the compiler tha ...
- 计算机基础知识 一 Basic knowledge of computers One
计算机硬件由CPU(Central Processing Unit).存储器.输入设备.输出设备组成. CPU通常由控制单元(控制器)和算数逻辑单元(运算器)组成. 运算器:负责进行算数运算和逻辑运算 ...
- iOS Objc Runtime 教程+实例Demo
样例Demo 欢迎给我star!我会继续分享的. 概述 Objc Runtime使得C具有了面向对象能力,在程序执行时创建,检查.改动类.对象和它们的方法.Runtime是C和汇编编写的,这里http ...
- Android Studio accelerator key(shortcut)& Basic knowledge
shift + F6 重构(选文件,ok->下面的控制台,do refactor option + return 快速修复 Activity@Extra() Intent: @FragmentA ...
- NoSql basic knowledge
The big picture to keep in mind first is: There are lots of articles and resources out there: http:/ ...
- [Tango] Basic Knowledge
Project Tango类设备能够给开发者在哪些领域带来机会. 室内导航*:室内GPS信号的缺失,使得Project Tango设备会成为室内导航重要应用场景之一.有了它,你就不会在不熟悉的室内商场 ...
随机推荐
- web.py尝试性学习!
首先导入web.py模块! import web 没有的话就: pip install web web.py的URL结构: urls = ( '/', "index" ) 第一部分 ...
- JS - 函数,Math,number
函数分为:关键字function 匿名函数 — 没有名字的函数 有名函数 — 有名字的函数 <body> <div></div> <script> // ...
- PHP Token(令牌)设计 避免重复提交
设计目标: 避免重复提交数据. 检查来路,是否是外部提交 匹配要执行的动作(如果有多个逻辑在同一个页面实现,比如新增,删除,修改放到一个PHP文件里操作) 这里所说的token是在页面显示的时候,写到 ...
- Redis hash数据结构
1, 新增一个 hash 或者 新增数据 => hset key field value 2, 获取某个字段值 => hset key field 3, 获取所有字段值 => hge ...
- 13.小结Action
转自:https://wenku.baidu.com/view/84fa86ae360cba1aa911da02.html 在struts2中一个普通的java类只要有public String ex ...
- 5.log4j报错
java.lang.UnsupportedClassVersionError: org/apache/log4j/Logger : Unsupported major.minor version 51 ...
- clip-path的任意元素的碎片拼接动效
看了张大神的这篇文章后自己写的,兼容性不好clip-path要加-webkit- css #test img{position: absolute;} .active .clip{ will-chan ...
- VBA 定义能返回数组公式的自定义函数
返回一个变量大小结果数组的方法 此方法返回基于一个参数范围的值的数组.结果数组的大小具体取决于参数数组中的元素数量波动.例如对于假定您要创建一个范围中的每个值乘以 100 的函数.下面的自定义函数接受 ...
- python之内置函数:map ,filter ,reduce总结
map函数: #处理序列中的每个元素,得到的结果是一个'列表',该列表元素个数及位置与原来一样 filter函数: #遍历序列中的每个元素,判断每个元素得到一个布尔值,如果是true,则留下来 peo ...
- webserive学习记录1-jdk自带webservice
最近在看webservice有视频,想年后找工作时增加点资本,视频终于看完了,自己又增加了些东西,现在就把视频中学到的和自己发现的东西总结一下. java jdk中自带一个轻量级的webservice ...