The Uitableviewcontroller and TableView in the iphone and ipad development should be more of a control.
But you will be bored by writing these controls too much.
How to make this control work all the time. How to make this control easy 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.
Then we can write similar functions in the. m file. For example, when there is no data to display a temporary no data or data loaded in the picture.
TableView more out of the place show blank and so on.
And then the other inheritance has a similar trait.
2.dataSouce content Integration in Uitableviewcontroller it's too lame.
All we have to do is extract the data.
First of all
Very easy isn't it.
We're going to define a block. You can also use delegate to see people like this block is used to get the cell and differentiate between different cells.
And then the corresponding proxy method to implement it OK
Watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvd2pzemy=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70 /gravity/center ">
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
IOS teaches you to play Uitableviewcontroller and TableView