简体   繁体   English

如何自动加载子视图进行测试?

[英]How to automatically load subviews for testing?

I'm writing an iOS app that has a problem on a view that's about 4 taps deep into the UINavigation stack. 我正在编写一个iOS应用程序,该视图在UINavigation堆栈的深度约为4个点的视图中存在问题。 It's becoming a pain to have to repeatedly tap tap tap through the simulator to drill down to the UIViewController I need every time I want to run the thing. 通过模拟器重复点击水龙头来深入到每次我想要运行的东西时需要的UIViewController这已经变得很痛苦。

Is there a way to automate this? 有没有办法实现自动化?

I tried just instantly calling [self tableView:self.tableView didSelectIndex... manually, however that blows up because data hasn't been loaded into the table yet... 我试着立即调用[self tableView:self.tableView didSelectIndex...手动,但是由于数据尚未加载到表中而导致...

I'd prefer something fast w/oa lot of overhead to it - otherwise it'll take more time to implement the solution than I'd save by not tapping the screen 4 times... 我更喜欢快速而不需要大量开销的东西 - 否则它需要更多的时间来实现解决方案而不是通过不点击屏幕4次来节省...

Thanks for any insight you guys can provide. 感谢您提供的任何见解。

I do this all the time - in the appDelegate, I just add some code wrapped in a #ifdef that just makes the subview the initial view of the navigation controller. 我一直这样做 - 在appDelegate中,我只是添加一些包含在#ifdef中的代码,它只是使子视图成为导航控制器的初始视图。 Once you get the subview working you can turn the ifdef off. 一旦你使子视图工作,你可以关闭ifdef。 Using the technique will save you lots of time - in fact I'm using it right now to add functionality to my app in the store. 使用该技术可以节省大量时间 - 事实上我现在正在使用它来为我的应用程序添加功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM