신속

2016-06-13 2 views
0
나는 데이터베이스를 생성하는 코드 아래했지만, 이것이 내가에서 잘못 가고처럼 보이는 let part1DbPath = "/Users/username/Documents/"

신속

import UIKit 

class ViewController: UIViewController { 
    let part1DbPath = "/Users/username/Documents/" 

    override func viewDidLoad() { 
     super.viewDidLoad() 
     // Do any additional setup after loading the view, typically from a nib. 
    } 

    override func didReceiveMemoryWarning() { 
     super.didReceiveMemoryWarning() 
     // Dispose of any resources that can be recreated. 
    } 

    func openDatabase() -> COpaquePointer { 
     var db: COpaquePointer = nil 
     if sqlite3_open_v2(part1DbPath, &db, SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE, "") == SQLITE_OK { 
      print("Successfully opened connection to database at \(part1DbPath)") 
     return db 
     } else { 
      print("Unable to open database. Verify that you created the directory described " + 
      "in the Getting Started section.") 
     } 
    return db 
    } 
} 

근처 나 실행 시간 동안 브레이크 포인트 오류를 ​​스레드 반환

데이터베이스 경로 선언. 이게 뭐가 잘못 됐니? 어떻게 작동하게합니까? 어떤 도움

enter image description here

+0

어디에서 응용 프로그램을 실행하고 있습니까? 시뮬레이터 또는 실제 장치? –

+0

@LucaDavanzo 시뮬레이터를 사용 중입니다. – SunShine

+0

아래에서 대답을 읽으면 간단히 중단 점이 설정됩니다. 걱정하지 마십시오! –

답변

0

당신은 실행을 중지합니다 코드에서 중단 점을 설정할 수 있습니다 주셔서 감사합니다. 이것은 오류가 아니지만 실행 중일 때 코드를 검사하는 데 사용됩니다. 이를 "디버깅"이라고하며 매우 유용합니다.

줄의 왼쪽에있는 파란색 마커를 클릭하여 중단 점을 제거하거나 디버그보기를 사용하여 실행을 계속하도록 선택할 수 있습니다 ("재생"단추 누르기).

디버그보기가 열려 있지 않은 경우보기 하단의 작은 화살표를 눌러 열 수 있습니다.