지도를 다시 가져 오기 위해 함수를 호출하려고합니다. 이 작업을 수행 할 때마다 다음 오류가 발생합니다.사전에 채워지지 않은 것 같습니다.
[[:]]
fatal error: unexpectedly found nil while unwrapping an Optional value
지도가 다음 코드를 통해 채워집니다.
class TableViewController: UITableViewController {
var activePlace = 0;
var places = [Dictionary<String,String>()];
//an array of maps, each map containing the data we need like long and lat
override func viewDidLoad() {
super.viewDidLoad()
if(places.count == 1){
places.removeAtIndex(0);
}
places.append(["name":"Taj Mahal", "lat":"27.175282", "lon":"78.042209"]);
}
그리고
이 코드override func viewDidLoad() {
super.viewDidLoad()
let tableView = TableViewController();
var places = tableView.getArrayOfDetails();
var index = tableView.getActivePlace();
println(places);
가 널이되게되어있는 viewDidLoad 메소드가 실행되는 순서 비아라고?
동시에, varActivePlace = 7을 변경하면; 그런 다음 viewDidLoad에서 출력 한 다음 올바르게 표시되어 왜지도가 비어 있는지 알 수 없습니까?
감사