////setterMethod The setting device,a method that assigns a value to an instance variable specifically
//-(void) SetName: (NSString *) name;
//-(void) Setage: (Nsinteger) age;
//-(void) Setsex: (NSString *) sex;
//-(void) Setweight: (cgfloat) weight;
//-(void) SetHeight: (cgfloat) height;
//
////getterMethod Accessors,a way to get the contents of an instance variable
//-(NSString *) name;
//-(NSString *) sex;
//-(Nsinteger) age;
//-(cgfloat) weight;
//-(cgfloat) height;
//[Method Name]changername:age:sex:weight:height:
//determine a method name
// Span style= "font-style:normal;font-variant:normal;font-weight:normal;font-family: ' Heiti SC light ';" > Remove the return value type remove formal parameter type and formal parameter name
//oc no duplicate definitions are allowed
//+ Span style= "font-style:normal;font-variant:normal;font-weight:normal;font-family: ' Heiti SC light ';" > You can only call with the class name
//+ instance variables cannot be used in the number method , because there's no object created at all , Memory Store Instance variable only if object is created ;
+ (void) testmethod{
NSLog (@ "Hello");
////NSLog (@ "Hello%@", _name);// of the wrong
//}
// The initialization method is used only once in the life cycle of an object
//ifAclass. hintroducedBClass of. hfile, Bclass and introduceAheader file for class,causes the header file loop to introduce errors
//Solution Solutions:
//There are only two cases that need to be. hthe introduction of other header files inside, 1is inherited, 2is the agreement.requires a header file except for the secondary,All to. Mreferenced in file. hIf you want to use this type in the,Use@classKey Words, @classThe function is to tell the compiler that it is a type,does not introduce the contents of this file.
This article is from the "ios--Training" blog, so be sure to keep this source http://zys2007.blog.51cto.com/8207599/1602682
obj-c2[instance variable visibility and method]