fork download
  1. func test() -> Void {
  2. self.getLocation(self.newAddressLocation) { [unowned self] (location, error) in
  3. guard let loc = location else {
  4. print(error?.localizedDescription)
  5. return
  6. }
  7.  
  8. print(loc + ".")
  9. self.performSegueWithIdentifier("mainToNewAddress", sender: self)
  10. }
  11. }
  12.  
  13. func getLocation(address: CLLocation, completion:(location: String?, error: NSError?) -> Void) -> Void {
  14. CLGeocoder().reverseGeocodeLocation(address, completionHandler: {(placemarks, error) -> Void in
  15. dispatch_async(dispatch_get_main_queue(), {
  16. if error != nil {
  17. completion(location: nil, error: error)
  18. }
  19. else if placemarks?.count > 0 {
  20. completion(location: placemarks?.first!.name!, error: nil)
  21. }
  22. else {
  23. let err = NSError(domain: "getLocation", code: -9901, userInfo: [kCFURLLocalizedTypeDescriptionKey:"Problem with the data received from geocoder"])
  24. completion(location: nil, error: err)
  25. }
  26. });
  27. })
  28. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 345: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 345: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 345: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 413: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 413: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 500: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 510: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 500: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 510: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 540: /dev/null: Permission denied
/usr/share/GNUstep/Makefiles/GNUstep.sh: line 540: /dev/null: Permission denied
prog.m:1:5: error: unknown type name 'func'
     func test() -> Void {
     ^
prog.m: In function 'test':
prog.m:1:17: error: expected declaration specifiers before '->' token
     func test() -> Void {
                 ^
prog.m:13:5: error: unknown type name 'func'
     func getLocation(address: CLLocation, completion:(location: String?, error: NSError?) -> Void) -> Void {
     ^
prog.m:13:29: error: expected ')' before ':' token
     func getLocation(address: CLLocation, completion:(location: String?, error: NSError?) -> Void) -> Void {
                             ^
prog.m:28:5: error: expected '{' at end of input
     }
     ^
prog.m:28:5: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
stdout
Standard output is empty