AX ERROR when using Accessibility Inspector for iOS app.

前端 未结 3 876
名媛妹妹
名媛妹妹 2021-02-18 19:53

I\'m testing an iPhone app with the simulator. Whenever I click on certain elements, I receive this error in console:

AX ERROR: Could not find my mock parent, mo         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-18 20:19

    Cool!

    I just have this strange error when using MJPopupBackgroundView. After checking its codes for a while, I noticed that, the author added a UITableView to another UIViewController's view as a sub view, but he didn't add the table's view controller to the other UIViewController as a child view controller.

    So the solution is quite easy, after adding a sub view like this:

    [parentViewController.view addSubview:childViewController.view];
    

    You only need to add one more line like this:

    [parentViewController addChildViewController:childViewController];
    

    Voila!

提交回复
热议问题