In fact, UITableView should be the most frequent use of a control in iOS development, a chat joke between colleagues said "a page, if you do not use UITableView, it is not called a page." Although it is the most common control, his strength is undeniable and a high-error control.
1.
In fact, this method has been around for a long time, but I would like to accept the new things less ability of people, or not used to.
Use this method to use a companion
-(void) registernib: (Nullable uinib *) nib Forcellreuseidentifier: (NSString *) identifier Ns_available_ IOS (5_0); -(void) RegisterClass: (Nullable Class) Cellclass forcellreuseidentifier: (NSString *) identifier ns_available _ios (6_0);
Need to register in front of the cell, and then use, the specific method on the web should have a lot of introduction, here I will not say, so use the code is very neat.
However, it is necessary to note that if you do not register with the advanced line, it will cause a crash.
The first flashback to be explained today is the cause of this,
Self.tableView.separatorStyle = Uitableviewcellseparatorstylenone;
The above code looks normal, but the main character that causes the flashback today is it, because it adds the wrong position.
it was placed before registering the cell. , TableView in the setting of the split line, found its own cell, found that the cell did not, and then caused the flash back.
Solution to the
Self.tableView.separatorStyle = Uitableviewcellseparatorstylenone; put in
After the registe is ready;
2.layout caused by the flash back
-(void) layoutsubviews{ [Super Layoutsubviews];}
Hey!!! is a very common code ah, although the predecessors often educate us, do not deal with too much logic here, code, but we still like to put a lot of code, especially the effect on this inside, because it is really useful.
But here is easy to use is good, but can not be used, here to tell the truth, is really should not put too much processing, unless have to, and use the time also have to pay attention to the place, this time we flash together is in
[Super Layoutsubviews];
There are some autolayout operations behind, resulting in a crash
Above is I today and you share a bit of development problems encountered, welcome you master to add Ah, said the wrong place to correct!!!
Crash issues caused by IOS UITableView