2014-10-31 6 views
0

앱에 MapKit을 사용하고 있습니다.구성 요소가있는 중단 점 SeasonatedByString()

글로벌 사전에 정보를 저장하고 있으며 다시 액세스 중입니다.

각 키는 텍스트 + 사용자 이름 + 날짜의 키로 저장됩니다. 이 경우에 사용자 이름 변수는 중단 점에서 중지 username = annotation.title 줄에 문자열

func mapView (mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView{ 
    var pinView = MKPinAnnotationView() 
    var imageView: UIImageView = UIImageView() 
    var button: UIButton = UIButton() 
    let username = annotation.title!.componentsSeparatedByString(" - ") 
    var string: String = annotation.subtitle! + username[0] + username[1] as String! 
    println(string) 
    println(PPs[string]) 
    var pp = PPs[string] 

의 날짜와 사용자 이름을 포함이 라인 (내가 그들을 꺼져).

EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT, subcode=0xe7ffdefe) 

나는 사용자 이름을 선언 할 때 무엇이 ​​잘못되었는지 궁금해합니다. 나는 let과 var을 모두 시도했습니다.

답변

1

이는 대부분 annotation 또는 annotation.title이 없음을 의미합니다. 함수 본문의 첫 번째 줄에 중단 점을 넣고 annotation 매개 변수를 검사하는 것이 좋습니다.

+0

xcode의 버그 였지만 오류가 잘못된 줄에있었습니다. –