Home > Mobile >  IOS development, today have a more difficult problem, about the tableview
IOS development, today have a more difficult problem, about the tableview

Time:09-27

Consignee's list is a tableview, each corresponding to a consignee cell, the consignee's data from the background, the consignee can edit, add, delete, now the question is: when the consignee is more long, delete a consignee, then slide the tableview, program crashes, consignee more refers to a screen, the consignee is beyond the error data source is the cause of the array is empty, now I don't understand is: why only appear when the consignee is this bug! now very depressed, we give some analysis,

CodePudding user response:

Show the BreakPoint Navigator - & gt; Click on the lower right corner "+" -- -- -- & gt; The Add Exception BreakPoint... - & gt; Breakpoint inside All Exceptions,

Run the program, waiting for the error, then positioning error code to you,

CodePudding user response:

In accordance with the above method to locate the reason for the error;
Speculation is because when you remove the Cell, lead to the data are not synchronized;

CodePudding user response:

Look at your specific code I will appear this kind of circumstance

CodePudding user response:

refer to the second floor ravatar0423 response:
in accordance with the above method to locate the reason for the error;
Speculation is because when you remove the Cell, lead to the data are not synchronized;

Estimates that is why you say this

CodePudding user response:

You delete a consignee, tableView and array is how operation? Should be there is something wrong with the operation

CodePudding user response:

Delete the form of data, corresponding data source have to delete the line?

CodePudding user response:

Should prompt is an array of operating the refresh tableView

CodePudding user response:

Deletes data cell, also want to delete

CodePudding user response:

Can cell reuse problems or belong to the time-consuming operation data from the background, the data after operation should return to the main thread, refreshes the UITableView in the main thread, it could also be delete cell, the cause of the data is not deleted

CodePudding user response:

You this is clearly an array errors, caused by the program to flash back, delete the cell, remember to delete your data source (in other words, delete the corresponding data in the model).
  •  Tags:  
  • iOS
  • Related