首页 \ 问答 \ iOS8 - 代码中是否有UIAutomation框架的示例?(iOS8 - is there an example of UIAutomation framework from code?)

iOS8 - 代码中是否有UIAutomation框架的示例?(iOS8 - is there an example of UIAutomation framework from code?)

我一直在阅读使用乐器的UI自动化,旧文档建议使用javascript库访问最前面的应用程序,然后访问UI视图层次结构。

我看到iOS8设备在设置中的开发人员菜单中具有“启用UI自动化”选项。 我还看到iOS8中的UIAutomation框架有一些文档,在我看来,它允许从代码中执行UIAutomation。

是否有从代码中使用iOS8 UIAutomation框架的示例,我可以看一下,了解这是否适用于我的框架?

我在UIAutomation框架上查看信息时会看到这个屏幕,我认为它让我觉得它在Obj-c或Swift中可用,因为顶部有按钮。 有人可以确认这个框架在swift或Obj-c中都不可用,并且仍然是一个javascript框架吗?

在此处输入图像描述


I've been reading about UI automation using instruments, and the old documentation suggested that this is done using a javascript library to access frontmost app, then access UI view hierarchy.

I see that an iOS8 device has "Enable UI automation" option in the developer menu in settings. I also see that there's some documentation on the UIAutomation framework in iOS8, which seems to me like it allows to do UIAutomation from code.

Are there examples of using iOS8 UIAutomation framework from code that I can look at to understand if this is the framework for me?

I see this screen when looking for the info on UIAutomation framework, and I think it confused me into thinking that it is available in Obj-c or Swift, because of buttons on top. Can someone confirm that this framework is NOT available in either swift or Obj-c and is still a javascript framework?

.

enter image description here


原文:https://stackoverflow.com/questions/25728707
更新时间:2023-06-28 21:06

最满意答案

你可以使用maskffill

begin_cond = (df['SPEED'] == 0) & (df['SPEED_END'].shift(1) == 0)
df['BEGIN'] = df['BEGIN'].mask(begin_cond).ffill().astype(int)

基本上, mask将替换df['BEGIN']中的值,其中begin_condNaNTrue 。 然后, ffill将使用df['BEGIN']的最后一个有效值向前填充NaN值。

结果输出:

   BEGIN  SPEED  SPEED_END
0    322     28          0
1    322      0         23
2    496      5          1
3    500      0          0
4    500      0          0
5    500      0          0
6    500      0          0
7    500      0         14
8   1050     11          6

You can use mask and ffill:

begin_cond = (df['SPEED'] == 0) & (df['SPEED_END'].shift(1) == 0)
df['BEGIN'] = df['BEGIN'].mask(begin_cond).ffill().astype(int)

Essentially, mask will replace the values in df['BEGIN'] where begin_cond is True with NaN. Then, ffill will forward fill the NaN values with the last valid value in df['BEGIN'].

The resulting output:

   BEGIN  SPEED  SPEED_END
0    322     28          0
1    322      0         23
2    496      5          1
3    500      0          0
4    500      0          0
5    500      0          0
6    500      0          0
7    500      0         14
8   1050     11          6

相关问答

更多

相关文章

更多

最新问答

更多
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的
  • SimplePie问题(SimplePie Problem)
  • 在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
  • HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
  • 为什么我会收到链接错误?(Why do I get a linker error?)
  • 如何正确定义析构函数(How to properly define destructor)
  • 垂直切换菜单打开第3级父级。(Vertical toggle menu 3rd level parent stay opened. jQuery)
  • 类型不匹配 - JavaScript(Type mismatch - JavaScript)
  • 为什么当我将模型传递给我的.Net MVC 4控制器操作时,它坚持在部分更新中使用它?(Why is it that when I pass a Model to my .Net MVC 4 Controller Action it insists on using it in the Partial Update?)
  • 在使用熊猫和statsmodels时拉取变量名称(Pulling variable names when using pandas and statsmodels)
  • 如何开启mysql计划事件
  • 检查数组的总和是否大于最大数,反之亦然javascript(checking if sum of array is greater than max number and vice versa javascript)
  • 使用OpenGL ES绘制轮廓(Drawing Outline with OpenGL ES)
  • java日历格式(java Calendar format)
  • Python PANDAS:将pandas / numpy转换为dask数据框/数组(Python PANDAS: Converting from pandas/numpy to dask dataframe/array)
  • 如何搜索附加在elasticsearch索引中的文档的内容(How to search a content of a document attached in elasticsearch index)
  • LinQ to Entities:做相反的查询(LinQ to Entities: Doing the opposite query)
  • 从ExtJs 4.1商店中删除记录时会触发哪些事件(Which events get fired when a record is removed from ExtJs 4.1 store)
  • 运行javascript后如何截取网页截图[关闭](How to take screenshot of a webpage after running javascript [closed])
  • 如何使用GlassFish打印完整的堆栈跟踪?(How can I print the full stack trace with GlassFish?)
  • 如何获取某个exe应用程序的出站HTTP请求?(how to get the outbound HTTP request of a certain exe application?)
  • 嗨,Android重叠背景片段和膨胀异常(Hi, Android overlapping background fragment and inflate exception)
  • Assimp详细说明typedef(Assimp elaborated type refers to typedef)
  • 初始化继承类中不同对象的列表(initialize list of different objects in inherited class)
  • 使用jquery ajax在gridview行中保存星级评分(Save star rating in a gridview row using jquery ajax)
  • Geoxml3 groundOverlay zIndex(Geoxml3 groundOverlay zIndex)