Simple Bluetooth Question
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