func test() -> Void {
self.getLocation(self.newAddressLocation) { [unowned self] (location, error) in
guard let loc = location else {
print(error?.localizedDescription)
return
}
print(loc + ".")
self.performSegueWithIdentifier("mainToNewAddress", sender: self)
}
}
func getLocation(address: CLLocation, completion:(location: String?, error: NSError?) -> Void) -> Void {
CLGeocoder().reverseGeocodeLocation(address, completionHandler: {(placemarks, error) -> Void in
dispatch_async(dispatch_get_main_queue(), {
if error != nil {
completion(location: nil, error: error)
}
else if placemarks?.count > 0 {
completion(location: placemarks?.first!.name!, error: nil)
}
else {
let err = NSError(domain: "getLocation", code: -9901, userInfo: [kCFURLLocalizedTypeDescriptionKey:"Problem with the data received from geocoder"])
completion(location: nil, error: err)
}
});
})
}
ICAgIGZ1bmMgdGVzdCgpIC0+IFZvaWQgewogICAgICAgIHNlbGYuZ2V0TG9jYXRpb24oc2VsZi5uZXdBZGRyZXNzTG9jYXRpb24pIHsgW3Vub3duZWQgc2VsZl0gKGxvY2F0aW9uLCBlcnJvcikgaW4KICAgICAgICAgICAgZ3VhcmQgbGV0IGxvYyA9IGxvY2F0aW9uIGVsc2UgewogICAgICAgICAgICAgICAgcHJpbnQoZXJyb3I/LmxvY2FsaXplZERlc2NyaXB0aW9uKQogICAgICAgICAgICAgICAgcmV0dXJuCiAgICAgICAgICAgIH0KICAgICAgICAgICAgCiAgICAgICAgICAgIHByaW50KGxvYyArICIuIikKICAgICAgICAgICAgc2VsZi5wZXJmb3JtU2VndWVXaXRoSWRlbnRpZmllcigibWFpblRvTmV3QWRkcmVzcyIsIHNlbmRlcjogc2VsZikKICAgICAgICB9CiAgICB9CiAgICAKICAgIGZ1bmMgZ2V0TG9jYXRpb24oYWRkcmVzczogQ0xMb2NhdGlvbiwgY29tcGxldGlvbjoobG9jYXRpb246IFN0cmluZz8sIGVycm9yOiBOU0Vycm9yPykgLT4gVm9pZCkgLT4gVm9pZCB7CiAgICAgICAgQ0xHZW9jb2RlcigpLnJldmVyc2VHZW9jb2RlTG9jYXRpb24oYWRkcmVzcywgY29tcGxldGlvbkhhbmRsZXI6IHsocGxhY2VtYXJrcywgZXJyb3IpIC0+IFZvaWQgaW4KICAgICAgICAgICAgZGlzcGF0Y2hfYXN5bmMoZGlzcGF0Y2hfZ2V0X21haW5fcXVldWUoKSwgewogICAgICAgICAgICAgICAgaWYgZXJyb3IgIT0gbmlsIHsKICAgICAgICAgICAgICAgICAgICBjb21wbGV0aW9uKGxvY2F0aW9uOiBuaWwsIGVycm9yOiBlcnJvcikKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgcGxhY2VtYXJrcz8uY291bnQgPiAwIHsKICAgICAgICAgICAgICAgICAgICBjb21wbGV0aW9uKGxvY2F0aW9uOiBwbGFjZW1hcmtzPy5maXJzdCEubmFtZSEsIGVycm9yOiBuaWwpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBsZXQgZXJyID0gTlNFcnJvcihkb21haW46ICJnZXRMb2NhdGlvbiIsIGNvZGU6IC05OTAxLCB1c2VySW5mbzogW2tDRlVSTExvY2FsaXplZFR5cGVEZXNjcmlwdGlvbktleToiUHJvYmxlbSB3aXRoIHRoZSBkYXRhIHJlY2VpdmVkIGZyb20gZ2VvY29kZXIiXSkKICAgICAgICAgICAgICAgICAgICBjb21wbGV0aW9uKGxvY2F0aW9uOiBuaWwsIGVycm9yOiBlcnIpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgIH0pCiAgICB9
/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]
}
^