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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -