Skip to content

WKWebView swizzled -dealloc 崩溃 #5

@ocyisheng

Description

@ocyisheng
  • (void)load
    {
    // BAKit_Objc_exchangeMethodAToB(NSSelectorFromString(@"init"), @selector(ba_web_init));
    // BAKit_Objc_exchangeMethodAToB(NSSelectorFromString(@"initWithFrame"), @selector(ba_web_initWithFrame));
    BAKit_Objc_exchangeMethodAToB(NSSelectorFromString(@"dealloc"),
    @selector(ba_web_dealloc));

}

  • (void)ba_web_dealloc
    {
    //1.这里需要判断是否已经添加了observe
    if(hadAddObserve){
    [self ba_removeNoti];
    }
    //2.在之后应该调用ba_web_dealloc
    [self ba_web_dealloc];
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions