Not skipping Descendents
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.