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. 

你可能感兴趣的:(ios,Objective-C,it,ios开发,ios笔记)