代理和控制器 [英] Delegate and controller
本文介绍了代理和控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Delegate.h和Delegate.m,ViewController.h和ViewController.m文件及其用法有什么区别?
What is the difference between the Delegate.h and Delegate.m, and ViewController.h and ViewController.m files and their usage
推荐答案
委托是对象操作的附带事件,而控制器是必需的。它们也在物体的不同侧面;控制器控制所讨论的视图;
A delegate is incidental to the operation of the object, whereas a controller is required. They are also on different "sides" of the object; the controller controls the view in question; and the object delegates functionality to its delegate, if present, putting the controller above the object and the delegate beside it.
此外, .h <>
Also, .h
files contain declarations; .m
files contain code, if that was what you were asking.
这篇关于代理和控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文