CS193p 2013 Fall Lecture 2 notes

1.NSMutableArray,
2.All instance variable in an Objective-C object start out zero.(include pointer)
3.NSUInteger PK NSInteger:NSUInteger is going to be a 64-bit int,UNSigned int on an iPhone 5 and  it might only about 1 32-bit one back on iPhone 4 and before.
4.init is always going to return self.
5.instancetype means is this is going to return an object that is of the same instance ,same type, same class type as the object you sent this message to.
6.in .h @class PK #import “Card.h”
7.All properties start out with a value of 0(called nil for pointers to object).So all we need to do is allocate and initialize the object if the pointer to it is nil.This is called “lazy instantiation”.
8.arc4random() summary
9.@[@“0”,@“1”] to create an array.
10.array-accessing: e.g. rankStrings[self.rank];  or self.cards[index];
11.if you implement BOTH the setter and getter for a property,then you have to create the instance variable for the property yourself. e.g. add this line: @synthesize suit=_suit;  If you implement only the setter OR the getter (or neither),the compiler adds this @synthesize for you.
12.To call a class method e.g. [className classMethod];
13.Initialization in Objective-C happens immediately after allocation.Only call an init method immediately after calling alloc to make space in the heap for that new object and Never call alloc without immediately calling some init method on the newly allocated object. 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值