ios - EXC_BAD_ACCESS when swizzle popViewControllerAnimated: -
for logging navigation between controllers, use swizzling of -popviewcontrollersanimated: method. , causes strange crash exc_bad_access. can reason?
- (void)sw_popviewcontrolleranimated:(bool)animated { //1. top controller before pop //2. pop //3. top controller after pop //4. log nsstring *controllerfromidentifier = @""; __block nsstring *controllertoidentifier = @""; nsdictionary *controllerfromadditionalparams = @{}; uiviewcontroller *topcontroller = ((uinavigationcontroller*)self).topviewcontroller; [self sw_popviewcontrolleranimated:animated]; uiviewcontroller *topcontrollerafterpop = ((uinavigationcontroller*)self).topviewcontroller; }
Comments
Post a Comment