iPhone - 编写委托和重载方法
我想知道如何编写类委托并重载其方法。 一个例子:我想编写一个类(我将设置为对象的委托的类),它必须是 NSXMLParser 对象的新委托。我想编写一个重载 didStartElement 和foundCharacters 方法的方法。我该怎么做?
i would like to know how can i write a class delegate and overload its method.
An example : i would like to write a class ( a class that i'll set as delegate of an object ) that have to be the new delegate of an NSXMLParser object. And i would want to write a method that overload the didStartElement and foundCharacters methods. How can i do this??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要编写对象的委托,您必须使用 @protocol 。
要重载方法,您必须对要重载的对象进行子类化。
To write a delegate of an object you have to use @protocol .
To overload method you have to subclass the object you want to overload.