ios - How can I use a singleton model to manage CoreBluetooth? -


okay, have been checking out singleton model past couple of days , find singleton model need implement manage bluetooth current app. put in central manager , peripheral functions corebluetooth api in singleton defined. when tried call function viewcontroller, kept getting multiple errors "cannot invoke central manager argument list of type ((cbcentralmanager, diddiscoverperipheral: cbperipheral, advertisementdata: [string : anyobject], rssi: nsnumber).type)

bluecoremanager.shared.centralmanager(cbcentralmanager, diddiscoverperipheral: cbperipheral, advertisementdata: [string : anyobject], rssi: nsnumber) 

this 1 of many errors got. bluecoremanager singleton in above line.

so did more digging , found outdated source code on github used singleton model bluetooth management. saw singleton defined each function (select peripheral, connect peripheral, read peripheral etc) protocol defined each one. best practice? need write specific commands multiple peripherals. also, in source code, noticed corebluetooth api functions defined in singleton never called directly. functions called automatically if refer other functions in singleton? shed light on best way proceed?


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -