나는 다음을 수행하십시오내 자신의 메서드를 사용하여 UIAElementArray를 확장 할 수 있습니까?
function extend(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
return destination;
};
extend(UIAElementArray.prototype,
{
each: function(f)
{
for (i = 0; i < this.length; i++)
{
f(i, this[i]);
}
},
findFirst: function(f)
{
for (i = 0; i < this.length; i++)
{
if (f(this[i])) return this[i];
}
return null;
},
findLast: function(f)
{
for (i = this.length - 1; i >= 0; i--)
{
if (f(this[i])) return this[i];
}
return null;
}
});
을하지만) 나는 mainWindow.tableViews (에서 얻을 개체에 "각"기능을 사용하려고하면 [0] .cells(), "[객체 UIAElementNil] 함수가 아니다 "라는 말이 발생합니다. 어떻게 UIAElementArray.prototype에 추가하는 각 속성이 [object UIAElementNil]로 설정되어 있습니까? 그런 일이 생기면 시뮬레이터에서 UIAutomation 테스트를 실제 장치에서 실행하면 놀랍게도 작동합니다.
이 답변은이 요점을 완전히 놓칩니다. 질문은 JavaScript 기반 UIAutomation에있었습니다. ObjectiveC와는 아무런 상관 관계가 없습니다. – Till