title: Fixing an override func viewDidAppear
body: <p>I was following this guide:</p>
  
  <p><a href="https://codewithchris.com/iphone-app-connect-to-mysql-database/#app" rel="nofollow noreferrer">https://codewithchris.com/iphone-app-connect-to-mysql-database/#app</a></p>
  
  <p>and I'm having this problem with the override function:</p>
  
  <blockquote>
    <p>Argument names for method 'viewDidAppear(animated:)' do not match those of overridden method 'viewDidAppear'.</p>
  </blockquote>
  
  <p>Here's the code:</p>
  
  <pre><code>import Foundation
  import UIKit
  import MapKit
  
  class DetailViewController : UIViewController {
      @IBOutlet weak var mapView: MKMapView!
  
      var selectedLocation : LocationModel?
  
      override func viewDidAppear(animated: Bool) {
          // Create coordinates from location lat/long
          var poiCoodinates: CLLocationCoordinate2D = CLLocationCoordinate2D()
  
          poiCoodinates.latitude = CDouble(self.selectedLocation!.latitude!)!
          poiCoodinates.longitude = CDouble(self.selectedLocation!.longitude!)!
          // Zoom to region
          let viewRegion: MKCoordinateRegion = MKCoordinateRegionMakeWithDistance(poiCoodinates, 750, 750)
          self.mapView.setRegion(viewRegion, animated: true)
          // Plot pin
          let pin: MKPointAnnotation = MKPointAnnotation()
          pin.coordinate = poiCoodinates
          self.mapView.addAnnotation(pin)
  
          //add title to the pin
          pin.title = selectedLocation!.name
      }
  }
  </code></pre>
  
  <p><strong>EDIT</strong>: I've already tried adding an underscore to the function: </p>
  
  <pre><code>override func viewDidAppear(_ animated: Bool) 
  </code></pre>
  
  <p>and it ends up with this error: </p>
  
  <blockquote>
    <p>Thread 1: EXC_BAD_INSTRUCTION(code=l386_INVOP, subcode=0x0)</p>
  </blockquote>
  
  <p>the debug console shows this:</p>
  
  <pre><code>2018-01-26 23:22:28.557604 newapp[20449:3980593] [] nw_host_stats_add_src recv too small, received 24, expected 28
  2018-01-26 23:22:28.564085 newapp[20449:3980593] [] ____nwlog_simulate_crash_inner_block_invoke dlopen CrashReporterSupport failed
  2018-01-26 23:22:28.564632 newapp[20449:3980593] [] __nwlog_err_simulate_crash simulate crash failed "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
  2018-01-26 23:22:28.566176 newapp[20449:3980593] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:
          [x86_64] libnetcore-856.30.16
      0   libsystem_network.dylib             0x0000000111f99666 __nw_create_backtrace_string + 123
      1   libnetwork.dylib                    0x0000000112b65006 nw_socket_add_input_handler + 3164
      2   libnetwork.dylib                    0x0000000112b42555 nw_endpoint_flow_attach_protocols + 3768
      3   libnetwork.dylib                    0x0000000112b41572 nw_endpoint_flow_setup_socket + 563
      4   libnetwork.dylib                    0x0000000112b40298 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612
      5   libnetwork.dylib                    0x0000000112b5bae1 nw_endpoint_handler_path_change + 1261
      6   libnetwork.dylib                    0x0000000112b5b510 nw_endpoint_handler_start + 570
      7   libnetwork.dylib                    0x0000000112b731f9 nw_endpoint_resolver_start_next_child + 2240
      8   libdispatch.dylib                   0x0000000111d16978 _dispatch_call_block_and_release + 12
      9   libdispatch.dylib                   0x0000000111d400cd _dispatch_client_callout + 8
      10  libdispatch.dylib                   0x0000000111d1de17 _dispatch_queue_serial_drain + 236
      11  libdispatch.dylib                   0x0000000111d1eb4b _dispatch_queue_invoke + 1073
      12  libdispatch.dylib                   0x0000000111d21385 _dispatch_root_queue_drain + 720
      13  libdispatch.dylib                   0x0000000111d21059 _dispatch_worker_thread3 + 123
      14  libsystem_pthread.dylib             0x00000001120e94de _pthread_wqthread + 1129
      15  libsystem_pthread.dylib             0x00000001120e7341 start_wqthread + 13
  Data downloaded
  fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>