Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've been looking into this as well. You need to include the bluetoothmanager framework and header file in your project. It <em>should</em> be in </p> <p><strong>/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/PrivateFrameworks/BluetoothManager.framework/</strong> </p> <p>If the header file is not there, you'll need to grab a .h file that was generated from the library and include it in your project. I googled to find it; Here is one here:</p> <p><a href="http://iphone-dev.googlecode.com/svn/branches/include-1.2-sdk/include/BluetoothManager/" rel="noreferrer">http://iphone-dev.googlecode.com/svn/branches/include-1.2-sdk/include/BluetoothManager/</a></p> <p>Once that is added to your project, your import should look like this if the header file was already in the framework:</p> <pre><code>#import &lt;BluetoothManager/BluetoothManager.h&gt; </code></pre> <p>Or this if you added your own BluetoothManager.h file to your project:</p> <pre><code>#import "BluetoothManager.h </code></pre> <p>To toggle the bluetooth here is the code:</p> <pre><code>BluetoothManager *manager = [BluetoothManager sharedInstance]; [manager setEnabled:![manager enabled]]; </code></pre> <p>I have built a utility to do this myself and it does work. Note, if all you want to do is create a utility to toggle the bluetooth and exit, without any UI, create a new project in XCode and use the Window-based Application template. Add the code to the didFinishLaunchingWithOptions method and replace <code>[window makeKeyAndVisible]</code> with <code>exit(0)</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload