Commit 6e2b6dfb authored by 余玠's avatar 余玠

避免调用动态方法

parent 87a43534
...@@ -176,13 +176,14 @@ static NSUInteger kInstanceCounter = 0; ...@@ -176,13 +176,14 @@ static NSUInteger kInstanceCounter = 0;
[FlutterBoostPlugin sharedInstance].fParams = _params; [FlutterBoostPlugin sharedInstance].fParams = _params;
} }
//instead of calling [super viewWillAppear:animated];, call super's super [super viewWillAppear:animated];
struct objc_super target = { // //instead of calling [super viewWillAppear:animated];, call super's super
.super_class = class_getSuperclass([FlutterViewController class]), // struct objc_super target = {
.receiver = self, // .super_class = class_getSuperclass([FlutterViewController class]),
}; // .receiver = self,
NSMethodSignature * (*callSuper)(struct objc_super *, SEL, BOOL animated) = (__typeof__(callSuper))objc_msgSendSuper; // };
callSuper(&target, @selector(viewWillAppear:), animated); // NSMethodSignature * (*callSuper)(struct objc_super *, SEL, BOOL animated) = (__typeof__(callSuper))objc_msgSendSuper;
// callSuper(&target, @selector(viewWillAppear:), animated);
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
...@@ -220,13 +221,14 @@ static NSUInteger kInstanceCounter = 0; ...@@ -220,13 +221,14 @@ static NSUInteger kInstanceCounter = 0;
pageName:_name pageName:_name
params:_params params:_params
uniqueId:self.uniqueIDString]; uniqueId:self.uniqueIDString];
// instead of calling [super viewDidDisappear:animated];, call super's super [super viewDidDisappear:animated];
struct objc_super target = { //// instead of calling [super viewDidDisappear:animated];, call super's super
.super_class = class_getSuperclass([FlutterViewController class]), // struct objc_super target = {
.receiver = self, // .super_class = class_getSuperclass([FlutterViewController class]),
}; // .receiver = self,
NSMethodSignature * (*callSuper)(struct objc_super *, SEL, BOOL animated) = (__typeof__(callSuper))objc_msgSendSuper; // };
callSuper(&target, @selector(viewDidDisappear:), animated); // NSMethodSignature * (*callSuper)(struct objc_super *, SEL, BOOL animated) = (__typeof__(callSuper))objc_msgSendSuper;
// callSuper(&target, @selector(viewDidDisappear:), animated);
} }
- (void)installSplashScreenViewIfNecessary { - (void)installSplashScreenViewIfNecessary {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment