• 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
Not skipping Descendents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Not skipping Descendents


  • Subject: Not skipping Descendents
  • From: email@hidden
  • Date: Wed, 5 May 2004 11:02:49 -0700

Greetings all i'm using the directory enumerator to populate a users
menu but won't skip descendents am i doing something wrong?

- (void)populateUsersMenu;
{
NSString *file;

NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager]
enumeratorAtPath:@"/Users"];
[enumerator skipDescendents];

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

while (file = [enumerator nextObject])
{
[usersArray addObject:file];
NSLog(@"%@",file);
}
[pool release];

NSMenu *usersMenu = [[NSMenu alloc] initWithTitle:@"users"];
NSEnumerator *e = [usersArray objectEnumerator];
id object;

while(object = [e nextObject])
{
[usersMenu insertItemWithTitle:object action:nil
keyEquivalent:@"" atIndex:0];
}
[usersButton setMenu:usersMenu];
[usersMenu release];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Not skipping Descendents
      • From: Jeremy Dronfield <email@hidden>
    • Re: Not skipping Descendents
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Uninstalling an app
  • Next by Date: Re: NSApplicationMain const warning
  • Previous by thread: Re: Uninstalling an app
  • Next by thread: Re: Not skipping Descendents
  • Index(es):
    • Date
    • Thread