如何将 UITextView 的委托"出口连接到实现 UITextViewDelegate 协议的类?
How do you connect the "delegate" outlet of a UITextView to a class that implements UITextViewDelegate protocol?
我似乎找不到示例 在文档中
奇怪的是 UITextView 的代表"插座有拖放界面的东西,就像你可以将它连接到 另一个小部件但当然,我不想连接它到一个小部件,我想把它连接到一个现有的类.
The weird thing is the UITextView's "delegate" outlet has that drag 'n drop interface thingy, like you can wire it up to another widget but of course, I don't want to wire it up to a widget, I want to wire it up to an existing class.
如果您的意思是我如何将使用代码创建的对象作为我的文本视图的委托",只需设置委托属性(这就是拖动在 Interface Builder 中将为您做):
If you mean "how do I make an object that is created with code the delegate for my text view", just set the delegate property (this is what dragging in Interface Builder will do for you):
textView.delegate = yourDelegateObject;
这篇关于您如何连接“代表"?UITextView 的出口到实现 UITextViewDelegate 协议的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!