Overview
The basis of the compaction of My Learning iOS development in the basic grammar of the knowledge of the summary series, not to be inquisitive, only practical. The content of this paper is to be used frequently in the development process of the collection class, due to lack of project experience, the first to think of some of the basic grammar often used to do a summary.
The main contents of this article are as follows:
1.NSArray
2.NSMutableArray
Nsarray
1. Create: The two commonly used methods are the following form. It is important to note that the elements in the nsarray that differ from Java,oc can be of different object types.
ID obj1 = [[NSObject alloc]init]; ID obj2 = @ "Hushunfeng"; ID obj3 = @ "CMCC"; Nsarray *array = [Nsarray arraywithobjects:obj1,obj2,obj3,nil]; New syntax Nsarray *array2 = @[obj1,obj2,obj3];
The first method of definition is defined by the class method, which is the beginning of the array, and this technique should be remembered, and it is also useful to define the init of the instance method, which is not described here.
OBJECTIVE-C Foundation Compaction--basic use of Set