ios - Swift Error: Editor placeholder in source file -
hello implementing graph data structure. when try build application error "editor placeholder in source file"
the full graph implementation pulled waynebishop's github here https://github.com/waynewbishop/swiftstructures
class path { var total: int! var destination: node var previous: path! init(){ //error happens on next line destination = node(key: string?, neighbors: [edge!], visited: bool, lat: double, long: double) } }
i changed node
class around to:
public class node{ var key: string? var neighbors: [edge!] var visited: bool = false var lat: double var long: double init(key: string?, neighbors: [edge!], visited: bool, lat: double, long: double) { self.neighbors = [edge!]() } }
this error happens 5 times throughout code have built far. question has been asked, not answered.
i think error may due changes init()
in node
class. prior changes init()
. if is, how can add objects class? pardon me if not correct in programming terminology, relatively new oop.
you had this
destination = node(key: string?, neighbors: [edge!], visited: bool, lat: double, long: double)
which place holder text above need insert values
class edge{ } public class node{ var key: string? var neighbors: [edge] var visited: bool = false var lat: double var long: double init(key: string?, neighbors: [edge], visited: bool, lat: double, long: double) { self.neighbors = [edge]() self.key = key self.visited = visited self.lat = lat self.long = long } } class path { var total: int! var destination: node var previous: path! init(){ destination = node(key: "", neighbors: [], visited: true, lat: 12.2, long: 22.2) } }
Comments
Post a Comment