• 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
Re: Simple Bluetooth Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple Bluetooth Question


  • Subject: Re: Simple Bluetooth Question
  • From: Alain Schartz <email@hidden>
  • Date: Thu, 26 Jul 2007 01:03:26 -0700

I don't see anything wrong with your use of NSArray.

 Are you sure that you have some paired devices on your system (check this in your Bluetooth preferences, under "Devices" , paired devices show up in the upper table view). If not, use the "Set up new device" button to set up some paired device, then try again.

Alain



On Thursday, July 26, 2007, at 12:13AM, "Patrick Walker" <email@hidden> wrote:
>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
>
>
_______________________________________________

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: Uli Kusterer <email@hidden>
References: 
 >Simple Bluetooth Question (From: Patrick Walker <email@hidden>)

  • Prev by Date: Is pointer syntax logical?
  • Next by Date: Re: Simple Bluetooth Question
  • Previous by thread: Simple Bluetooth Question
  • Next by thread: Re: Simple Bluetooth Question
  • Index(es):
    • Date
    • Thread