• 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: Detecting iPods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting iPods


  • Subject: Re: Detecting iPods
  • From: email@hidden
  • Date: Mon, 26 Dec 2005 21:04:33 -0500

A common way you'll see if to check for the "iPod_Control" directory. Here's an example that should get you started:

- (NSArray*)connectediPods {
NSArray* allVolumes = [[NSWorkspace sharedWorkspace] mountedRemovableMedia];
NSMutableArray* iPodVolumes = [[NSMutableArray alloc] init];
int i;

for (i=0;i<[allVolumes count];i++)
{
NSString* iPodControlPath = [[allVolumes objectAtIndex:i]
stringByAppendingPathComponent:@"iPod_Control"];
if ([[NSFileManager defaultManager] fileExistsAtPath:iPodControlPath])
{
[iPodVolumes addObject:[allVolumes objectAtIndex:i]];
}
}

[iPodVolumes autorelease];
return iPodVolumes;
}

- (BOOL)deviceIsiPodAtPath:(NSString*) path {
return [[NSFileManager defaultManager] fileExistsAtPath:
[path stringByAppendingPathComponent:@"iPod_Control"]];
}

On Dec 26, 2005, at 8:54 PM, Eamon Ford wrote:

How do I tell if an iPod is mounted? I know I'd use NSWorkspace's mountedRemovableMedia method, but how do I tell if the device attached is an iPod?

Thanks,
Eamon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com

This email sent to email@hidden


M.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Detecting iPods (From: Eamon Ford <email@hidden>)

  • Prev by Date: Detecting iPods
  • Next by Date: Re: customizing save behavior in doc based apps
  • Previous by thread: Detecting iPods
  • Next by thread: Problems with large files
  • Index(es):
    • Date
    • Thread