简体   繁体   中英

Compare the dates and show the values in a table view

i have 2 test fields with from Date and to Date and a button. when the button is tapped the validation should take place then if the valid dates are given i want the data to be displayed in the tableView.

I am very much confused on where to write this code. Either in cellForRowAtIndexPath or in the IBAction method for the button?.

if its written in cellForRowAtIndexPath the validation is taking place when the view is loaded.and if its written in the method where should i write the code for displaying the data.

if i'm not wrong ,

it is better to do it in IBAction and then if you are setting values , if you think you are doing them right then the only thing you need to call is :

["your-table-view" reloadData];

then it will be done i guess..

i hope this helps..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM