蓝牙自动开启

时间:2016-04-03 08:32:52
【文件属性】:

文件名称:蓝牙自动开启

文件大小:253KB

文件格式:ZIP

更新时间:2016-04-03 08:32:52

Bluetooth

加入以下代码,实现自动开启,测试通过 -(void)startBluetooth{ #if TARGET_IPHONE_SIMULATOR exit( EXIT_SUCCESS ) ; #else Class BluetoothManager = objc_getClass( "BluetoothManager" ) ; id btCont = [BluetoothManager sharedInstance] ; [self performSelector:@selector(toggle:) withObject:btCont afterDelay:1.0f] ; #endif } #if TARGET_IPHONE_SIMULATOR #else - (void)toggle:(id)btCont { BOOL currentState = [btCont enabled] ; [btCont setEnabled:!currentState] ; [btCont setPowered:!currentState] ; } #endif


【文件预览】:
BluetoothExperiments-master
----.gitmodules(158B)
----BluetoothExperiments()
--------main.m(348B)
--------BluetoothExperiments-Info.plist(1KB)
--------BluetoothExperiments.entitlements(224B)
--------Assets()
--------Storyboards()
--------Libraries()
--------InfoPlist.strings(45B)
--------BluetoothExperiments-Prefix.pch(337B)
--------Classes()
----.gitignore(150B)
----README.md(174B)
----BluetoothExperiments.xcodeproj()
--------project.xcworkspace()
--------project.pbxproj(20KB)

网友评论