1. About Code Specifications
If you want to use lazy loading,
// Lazy Loading -(Cadisplaylink *) displaylink{ if (! _displaylink) { = [cadisplaylink displaylinkwithtarget:self selector: @selector (tododrawline)]; 3 ; } return _displaylink;}
When declaring a property, you need to use a form similar to the following
@property (Nonatomic,strong) Cadisplaylink *displaylink;
and cannot be written
@interface Barview () { *_displaylink;}
If written in an underlined form, the lazy loading method is not performed. Must be written in self form
It can be defined as an underscore only when lazy loading is not required.
Rounding of a 2.float or double type, without additional methods, can be handled with the stringWithFormat of the string. Such as:
NSLog (@"%@", [NSString stringWithFormat:@"%.0f",1.0003]); NSLog (@"%@", [NSString stringWithFormat:@"%.0f",1.9003]); NSLog (@"%@", [NSString stringWithFormat:@"%.0f",1.5003]); NSLog (@"%@", [NSString stringWithFormat:@"%.0f",1.4003]);
Printing results:
3. In order to prevent the button to repeat the click, it can be set to a few seconds cannot be clicked. Use
Performselector: @selector () Withobject:afterdelay:
On the line.
iOS work notes (11)