First, Class extension (class extension, anonymous classification)
1. Format
@Interface class name ()
{
Member variable ...
}
Method declaration ...
@end
1. Use
1> written in the. m file
2> is generally used to augment private member variables, @property properties, methods, etc.
Second, random number generation
1.arc4random () generates any positive integers and 0
2.arc4random_uniform (100) generates 0-99 integers (including 0 and 99)
Iii. Common methods of UIView
1.addSubview: (UIView *) Child
Add child controls (the newly added auto-control will be displayed at the top)
2.NSArray *subviews
The child controls added by the Addsubview: method will exist in this array
3.removeFromSuperview
Remove the control itself from the parent control (the control itself is also removed from the parent control's subviews array)
4. (UIView *) Viewwithtag: (int) Matag
* Returns a child control with a tag value of MyTag
* If there are more than one child control tag, only the first matching child control will be returned (the control itself is also included when searching for tag matching controls)
5.UIView *superview
Parent control
xcode--random numbers and UIView common methods