Please read the description in detail.
I have 3 views/pages in my app.
- Table view displays the list of names of Employes in a table view retrieved from data base. When select an employe pushed to the next vie details veiw.
-
Details view:Displays details of selected employee here
-
-
Roles table view: having N number of roles for employes in that organization. we can pic a role from here to set a role to an employee. -
Popup camera(iMagePicker) when we tap on employe profile pic image on details view.
-
Here i have problem on 2nd view Details view.
That i use the same view for two purpouses
.To Add new employee (if we select + add button on 1st vie)
. To edit existing employe if we tap on any row of employe in table
So to edit exist employe I passe a dictionary for the selecte employe details and fill the fields with the corresponding keys of dictionary when view will appear. So all fields displays employe details
To App i passes an empty dictionary when view will appear. so all fields are empty.
in this view i have option for capture picture, and a text field which navigates to the next view when we want to enter roles in it.
when i used these two senarios the view is navigates to some other views then the data i have typed in other fields is gets erased.
So can any advice *************
1. To shows empty fields for new employe, when we returns back to the view form camaera and roles table the data remains same what we have edited.
2.To display details of employes we can edit fileds and To shows empty fields for new contacts, when we returns back to the view form camaera and roles table the data remains same what we have edited.
Just changes some code..
I mean write your view fill up code in
viewDidLoadinstead ofviewWillAppearAs
viewWillAppearruns each time a view is shown to user, and your data/view is again refilled with your dictionary and edited data is lost.