The Uitableviewcontroller and TableView in the iphone and ipad development should be more of a control. But you're tired of writing these controls too much.
How to make this control work all the time, how to make it simple to write. is very necessary. In particular, uitableviewcontroller the business logic of Datasouce integration in their own body and let the look of chaos without a chapter.
1. The solution Uitableviewcontroller has been able to use.
That is to write a base class of Uitableviewcontroller, and then other to inherit. This allows similar functionality to be written to the base class.
For example, I created a base class of my own that defines an attribute isscroll used to determine when tableview can scroll.
We can then write similar functions in the. m file, such as displaying a picture without data or data loading.
TableView more out of the place show blank and so on.
And then the other inheritance of this has its similar characteristics.
2.dataSouce content Integration in Uitableviewcontroller it's too lame.
All we have to do is extract the data.
First of all
It's simple, isn't it.
We're going to define a block. You can also use delegate to see a person like this block is used to get the cell and distinguish between different cells
And then the corresponding proxy method to achieve it OK
Finally, let's see if our uitableviewcontroller really don't need to write these.
It's not like that end. Not a bit of datasource code OH. Use block to return to the implementation of the cell. Use the keys to differentiate the cell's choice.
Resource http://download.csdn.net/detail/wjszf/7762843