0
votes

I am developing an iPad application using storyboard. In my application I have connected one modal view controller from first view controller using segue modal presentation for fetching some data. Modal view controller is closed by clicking on the cancel button in the modal view. Cancel button and first view controller are connected by using a modal segue. In first view controller I have a table view and I added some values to the tableview using a button. But my problem is if go to modal view then return back to my first view controller the table view in the first view controller is reloaded and I lost the result in the tableview. How do I prevent the data reload in the table view when the modal view is dismissed on pressing cancel.

1
tried keeping your reload logic in viewwillappear: of first viewController.Rajesh
Are you giving a [table reload] in ViewWillAppear or ViewDidAppear, if yes then remove it from there. And also check if viewDidLoad is getting called when view is returned from modal View. If yes, make sure it won't happen.Dili
@Nithin did this solve your issue?Dili
@DILI I solved that problem by used dismissViewControllerAnimated:YES...Thank you for your helpNithin U S

1 Answers

0
votes

These two points may solve your issue

  • Don't give [table reload] in ViewWillAppear or ViewDidAppear
  • Make sure viewDidLoad is not getting called when view is returned from modal View