FoneMonkey able to input text to a UITextView?
So far found ways to get FoneMonkey to behave for most of what I'm scripting, however, when trying to enter text into a UITextView, it does not capture it during开发者_如何学Go recording. If I manually add a InputText command for the UITextView, it does not actually input the text.
I'm using the latest version (5.0b).
Unless I missed them, there are no specific examples in the doc showing a command for entering text in a UITextView (there are for UITextField, and that does work for me).
You can input text with the built-in FMCommandInputText
command, like so:
NSMutableArray *array = [NSMutableArray array];
[array addObject:[FMCommandEvent command:FMCommandTouch className:UITextView
monkeyID:TEXTVIEW_MONKEYID args:nil]];
[array addObject:[FMCommandEvent command:FMCommandInputText className:UITextView
monkeyID:TEXTVIEW_MONKEYID
args:[NSArray arrayWithObjects:yourText, nil]]];
result = [FoneMonkeyAPI playCommands:array];
Does this work?
精彩评论