• iOS dispatch_ After delayed execution results in delayed dealloc


    Let’s build a new oneNewViewController, at the beginningViewControllerWrite the following code – (void)viewDidLoad { [super viewDidLoad]; UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(100, 100, 100, 50); btn.backgroundColor = [UIColor brownColor]; [btn addTarget:self action:@selector(jump) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:btn]; } -(void)jump{ NewViewController *newVC = [[NewViewController alloc]init]; [self presentViewController:newVC animated:YES completion:nil]; } Then inNewViewControllerLi: -(void)dealloc{ NSLog(@”————–dealloc”); } – […]

  • IOS dynamic graph loading notes


    In the usage scenario, the effect of gift giving in the live broadcast. After clicking send gift, you need to display the dynamic graph GIF The current implementation scheme is to obtain the URL of the GIF graph from the server interface, and then start the display. After the display is completed, remove the picture […]

  • Reflection effect based on IOS


    This example shares the specific code of IOS to realize the reflection effect for your reference. The specific contents are as follows 1、 Brief description We can duplicate layers, create a duplicate layer, and then rotate it to add the corresponding color difference. The effect can be achievedWhen creating the interface, our view uses vcview […]

  • Three ways to change the direction of this


    Call, apply and bind are the methods to change the direction of this. Common ground: the first parameter is the pointer to change this. If the first parameter is null / undefined, this points to window by default Call (countless parameters) First parameter: change this pointSecond parameter: argumentThis function will be executed automatically after use […]

  • IOS block solves circular reference


    First, solve the circular reference I Basic controller code: #import “ViewController.h” ///The first two solve circular references typedef void(^CPBlock)(void); ///Used for the third solution to circular references typedef void(^CPParamBlock)(ViewController *); @interface ViewController () ///The first two solve circular references示例 @property(nonatomic, copy) CPBlock block; ///Used for the third solution to circular references示例 @property(nonatomic, copy) CPParamBlock paramBlock; […]

  • Implementation principle of spring AOP


    Through the previous articleSpring bean creation process and related extension pointsWe know the process of creating bean instances with getbean(), which has the following extension points: Implement the instantiaawarebeanpostprocessor interface before the bean instance is created After the bean instance is created successfully, a factory method is created immediately when the property is not set. […]

  • Image folding effect based on IOS


    This example shares the specific code of IOS to realize the image folding effect for your reference. The specific contents are as follows 1、 Analysis and description 1.1 analysis results When the mouse drags on the picture, there is a folding effect on the pictureThis folding effect is actually a rotation of the top half […]

  • Xcode set startup page


    Preface: there are two ways to set the startup page in IOS: launch image and launchscreen 1、 Launch image 1. Search for asset catalog launch image set name in project targets — build settings, and then set the name of the created launch page, as shown in the following figure. Launchimage1.png 2. In info Delete […]

  • Application, circular reference and bottom layer of block


    1、 Block syntax Return type (^ block name) (parameter type) = ^ return type (variable type variable name) {implementation} When a block is defined directly, the return type at the time of definition can be omitted, i.e Return type (^ block name) (parameter type) = ^ (variable type variable name) {implementation} If the parameter type […]

  • Music vibration bar effect based on IOS


    1、 Simple analysis The music vibration bar does not need to interact with the user. We can use the replication layer to operate. Add vibration bar. Add animation. Copy layer description //Create replication layer -(void)createRepl{ //Replication layer CAReplicatorLayer * repL = [CAReplicatorLayer layer]; repL.frame = self.contentV.bounds; //6 copies repL.instanceCount = 6; //Deformation, each deformation starts […]

  • Notes on stepping on the pit


    Avplayer is a commonly used video player component on Apple platform. Easy to use and good performance; However, some pits will be encountered during use. 1、 Buffer state judgment The following three attributes determine whether the video can be played Isplaybackbufferempty // the buffer is empty Isplaybacklikelytokeepup // playback is available Isplaybackbufferfull // the buffer […]

  • Learning notes of IOS underlying principles


    How to decompile OC code into C and C + + code? Using the front-end compiler clang of llvm built in Xcode, the generated code is not entirely the underlying implementation, but just a reference Command: Lang – rewrite objc file name M – O output file name cpp Specify the platform command: xcrun – […]