• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Simple Bluetooth Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple Bluetooth Question


  • Subject: Simple Bluetooth Question
  • From: Patrick Walker <email@hidden>
  • Date: Wed, 25 Jul 2007 19:16:45 -0400

First, I'm a ME student, not a CS student. I've really only started using Xcode since the beginning of the year and can write GUI apps but they're boring and rather useless for me.

I'm just futzing around with BT for a bit and wondering why I'm not getting any results when asking for paired devices. The result is always nil for any of the class (+) methods. I know there is an autorelease error but I'm not concerned about that atm. Am I using NSArray properly?

#import <Cocoa/Cocoa.h>
#import <IOBluetooth/objc/IOBluetoothDevice.h>

int main(int argc, char *argv[])
{
NSArray * btfav = [NSArray arrayWithArray:[IOBluetoothDevice pairedDevices]];

NSLog(@"Size of array: %i", [btfav count]);

if ([IOBluetoothDevice pairedDevices] == nil)
NSLog(@"Nothing in pairedDevices");
else
NSLog(@"Something in pairedDevices");


	if ([IOBluetoothDevice favoriteDevices] == nil)
		NSLog(@"Nothing in favoriteDevices");
	else
		NSLog(@"Something in favoriteDevices");

    return 0;
}

Output:

2007-07-25 18:55:41.548 Bluetooth[2437] Size of array: 0
2007-07-25 18:55:41.549 Bluetooth[2437] Nothing in pairedDevices
2007-07-25 18:55:41.549 Bluetooth[2437] Nothing in favoriteDevices


____________________________________

Patrick Walker
email@hidden
email@hidden
email@hidden



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Simple Bluetooth Question
      • From: Jacob Engstrand <email@hidden>
    • Re: Simple Bluetooth Question
      • From: Alain Schartz <email@hidden>
  • Prev by Date: NSUserDefaults for another Application
  • Next by Date: Search Menu Template and Bindings
  • Previous by thread: Re: NSUserDefaults for another Application
  • Next by thread: Re: Simple Bluetooth Question
  • Index(es):
    • Date
    • Thread