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设备会成为室内导航重要应用场景之一.有了它,你就不会在不熟悉的室内商场 ...
随机推荐
- 常用模块:os模块,logging模块等
一 os模块 那么作为一个常用模块,os模块是与操作系统交互的一个模块. 那么os模块中我们常用的一般有以下几种: os.listdir('dirname') 以列表的形式列出指定目录下的所有文 ...
- Django自带的用户认证
1. 创建超级用户 python manage.py createsuperuser 2. 认证 校验用户名和密码 obj = auth.authenticate(request,user ...
- time,sys,os 模块
import time# 时间戳时间,格林威治时间,float数据类型 给机器用的 # 英国伦敦的时间 1970.1.1 0:0:0 # 北京时间 1970.1.1 8:0:0 # 153369312 ...
- phpmyadmin快速安装
phpMyAdmin 就是一种 MySQL 数据库的管理工具,安装该工具后,即可以通过 web 形式直接管理 MySQL 数据,而不需要通过执行系统命令来管理,非常适合对数据库操作命令不熟悉的数据库管 ...
- spring data jpa 原生查询(查一个json中的某一字段)
数据库: jpa 查询 java: @Component("ediHistoryDAO") public interface EdiHistoryDAO extends CrudR ...
- S+ hidden tray with window start
官方论坛上有个帖子给出了答案: I forgot that this is supported in the code, but it requires a little editing of the ...
- 因为链接服务器 "SQLEHR" 的 OLE DB 访问接口 "SQLNCLI10" 无法启动分布式事务
1.运行 regedt32,浏览至 HKEY_LOCAL_MACHINE\Software\Microsoft\MSDTC. 添加一个 DWORD 值 TurnOffRpcSecurity,值数据为 ...
- Functional Java 学习笔记
Functional Java Functional Java是一个在Java语言中实现函数型编程范式的类库. 从接口上看,该类库似乎与Haskell语言关系密切,接口的方法名很多来自该语言. < ...
- 2017面向对象程序设计(Java)第三周学习总结
白驹过隙,日月如梭,一转眼,我们已经度过了第三周的学习时光,随着时间的一天天流逝,我么对知识的积累也逐渐增多.当然,我们还有许许多多需要改进的地方.下面,我将对第三周的助教工作进行总结,望老师及同学们 ...
- 利用简单的参数传递来实现单条查询的easyui-datagrid
前一阵子老师给出了一个题目, 说让设计个表格, 学生系统的, 可以查询学生的信息和成绩, 科目自己定, 数据库建表也自己定. 数据库的建表可是建的相当的简陋, 反正老师不是很满意, 后来数据表格做出来 ...