0
votes

i have tableview.In method 'viewWillAppear',it calls a function and function data is stored in an array named 'list'.Now in the method 'numberOfRowsInSection' method it returns the list count...and in another method 'cellForRowAtInexPath' it displays data in cell...now when the view is pushed to the above view using pushViewnavigationcontroller,function is called in viewwillappear and data is shown in tableview..now when i come back to previous view and move to tableview view again...viewWillAppear method is called(i checked using NSLog)...but tableview displays the same previous data..that means methods numberOfRowsInSection,cellForRowAtIndexPath are called only Once at first click..why is it so??and what can be done to load the tableview again and again with changing values of the data..??

1

1 Answers

0
votes

I found the solution by myself. Just use [tableview reloadData] in method viewWillAppear.