Obj-C instance variables and properties (ivar, property)

ref – http://stackoverflow.com/questions/7057934/property-vs-instance-variable http://stackoverflow.com/questions/9702258/difference-between-properties-and-variables-in-ios-header-file An instance variable is unique to a class. By default, only the class and subclasses can access it. Therefore, as a fundamental principal of object-oriented programming, instance variables (ivars) are private—they are encapsulated by the class. By contrast, a property is a public value that may or may not correspond to […]

ns copying

ref: http://stackoverflow.com/questions/4089238/implementing-nscopying To implement NSCopying, your object must respond to the -copyWithZone: selector. Here’s how you declare that you conform to it:

Then, in your object’s implementation (your .m file):

What should your code do? First, create a new instance of the object—you can call [[[self class] alloc] init] to get an initialized […]

Fast Enumeration with Collections

Fast enumeration is an Objective-C’s feature that helps in enumerating through a collection. Collections in Objective-C Collections are fundamental constructs. It is used to hold and manage other objects. The whole purpose of a collection is that it provides a common way to store and retrieve objects efficiently. There are several different types of collections. […]

static background in uitableview

ref: http://stackoverflow.com/questions/20481118/background-image-uitableview-changes-when-scroll http://stackoverflow.com/questions/1960603/iphone-fixed-position-uitableview-background

C++ reference

When you use a reference at the parameter, it gets bound to the outside variable that gets passed in. Namely, in our example, passByRef gets bound to variable. Modifications are made up the same address. A reference can only be bound ONCE. Thus, once it gets bound, any modification to that reference takes place outside […]