iOS Core Bluetooth (LE): App crash when handling different views -
iOS Core Bluetooth (LE): App crash when handling different views -
i have 2 views: 1 central tableview discovered devices appear , 1 detailview loads when user selects connect 1 of discovered devices.
it works until next point:
discovering devices connect device read services, characteristics , subscribe them values of char's beingness read , displayed on detailviewwhen homecoming detailview through "back"-button callback-function
override func viewdidappear(animated: bool) { if(!firststart){ tableview.reloaddata() println("appeared!") discoverdevices() }
}
gets called after end in exc_bad_access. discoverdevices() function following:
func discoverdevices() { println("discovering devices......") centralmanager.scanforperipheralswithservices(nil, options: nil) }
there seems error in "centralmanager.scanforperipheralswithservices(nil, options: nil)" - after callback. right start fine. have set delegate somewhere? can't figure out "exc_bad_access"-error.
do have re-initialize centralmanager? have restart it?
thanks help in advance.
kind regards, stevil
i found out myself. problem peripheral.delegate had set 1 time again in main tableview. running smooth.
maybe helps other newbies.
ios bluetooth exc-bad-access bluetooth-lowenergy cbcentralmanager
Comments
Post a Comment