我可以从UIResponderStandardEditActions调用select方法吗? [英] can I call a select method from UIResponderStandardEditActions?

查看:147
本文介绍了我可以从UIResponderStandardEditActions调用select方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用UITextView为iPad开发一个简单的文本编辑应用程序。
我想选择UITextView文本的部分并用默认的蓝色选择栏突出显示它。

I'm currently developing a simple text editing app for iPad using UITextView. I want to select parts of UITextView's text and highlight it with a default blue selection bar.

例如,我编写了这段代码来选择整个文档。

For example, I wrote this code to select the entire document.

[myTextView select: self]
myTextView.selectedRange = NSMakeRage(0, [textView.text length])

但select方法来自UIResponderStandardEditActions协议,描述为Apple文档中的非正式协议。
http://developer.apple。 com / library / ios /#documentation / uikit / reference / UIResponderStandardEditActions_Protocol / UIResponderStandardEditActions.html

But "select" method is from UIResponderStandardEditActions protocol described as an informal protocol in the Apple documentation. http://developer.apple.com/library/ios/#documentation/uikit/reference/UIResponderStandardEditActions_Protocol/UIResponderStandardEditActions.html

我想知道直接调用这种方法是否合法,因为大多数文本在AppStore中基于UITextView编辑应用程序没有选择UITextView部分的功能。因此,从UIResponderStandardEditActions调用方法似乎是非法的。

I wonder whether it's legal to call this method directly because most text editing apps based on UITextView in AppStore didn't have functionality to select parts of UITextView. So calling methods from UIResponderStandardEditActions seems illegal.

谢谢!

推荐答案

如果它在文档中,您可以使用它。

If it is in the documentation, you can use it.

这篇关于我可以从UIResponderStandardEditActions调用select方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆