Let's say private methods,
Due to the dynamic messaging mechanism of objective-c, there is no real private method in OC.
But if you do not declare in the. h file, only in the. m file, or in the class extension of the. m file, it is basically the same as the private method.
Private variables can be declared by @private, for example
@interface sample: { @private nsstring * Tteesstt;} @property (nonatomic,strong< Span class= "P" >) nsstring *hoge; - (void) foo; @end
Then the TTEESSTT variable is private. The property Hoge is the default public.
Apple's official document now uses more property than the direct definition of instance variable. The class extension that defines the property to. M is also basically the same as a private variable.
In a nutshell, put the. h file that you want to have, and put it in the. m file privately. Import only. h files (. m files are also available for import, but we do not generally do so).
Objective-c How do private variables and private methods work?