I am trying to learn Xcode using iOS 14 Programming for Beginners.
I some how made an error when working through the instructions in the book. There are 2 navigation controllers and I connected a view controller to the wrong Navigation controller. When I realised my mistake I deleted the segue between the wrong Navigation Controller and the view controller. I then Ctrl + Dragged from the correct Nav Controller to the view controller and then created a new View Controller and did the same to this controller to the other Nav controller.
If I build the app every thing seems to work, except the Nav controller does not load the Map view when I click on the map icon, even though I have added the Map View to the View Controller.
Please help?
I some how made an error when working through the instructions in the book. There are 2 navigation controllers and I connected a view controller to the wrong Navigation controller. When I realised my mistake I deleted the segue between the wrong Navigation Controller and the view controller. I then Ctrl + Dragged from the correct Nav Controller to the view controller and then created a new View Controller and did the same to this controller to the other Nav controller.
If I build the app every thing seems to work, except the Nav controller does not load the Map view when I click on the map icon, even though I have added the Map View to the View Controller.
Please help?
You need to connect with a Relationship segue.
If that doesn't work:
You said in initial post:
Is it a button in a tab bar ?
What is the ViewController that contains the map ?
You may have to explain more precisely your set up.
such as:
Nav A -> VC A
Nav B -> VC B
VC B contains map button (where ? In tab bar, directly in the view ?)
button segues to VC C
VC C contains a mapView
Control drag from the root to the next VC and use relationship segue (root view controller) from the Navigation controller to the top VC in the navigation stack.
And don't forget to do an option-clean build Folder.
If that doesn't work:
You said in initial post:
Where is this map icon ?except the Nav controller does not load the Map view when I click on the map icon, even though I have added the Map View to the View Controller.
Is it a button in a tab bar ?
What is the ViewController that contains the map ?
You may have to explain more precisely your set up.
such as:
Nav A -> VC A
Nav B -> VC B
VC B contains map button (where ? In tab bar, directly in the view ?)
button segues to VC C
VC C contains a mapView