Delegate and controller
What is the difference between the Delegate.h and Delegate.m, and ViewController开发者_Go百科.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.
Also, .h
files contain declarations; .m
files contain code, if that was what you were asking.
精彩评论