NSHomeDirectory not working with NSOpenPanel
NSHomeDirectory not working with NSOpenPanel
- Subject: NSHomeDirectory not working with NSOpenPanel
- From: John Tsombakos <email@hidden>
- Date: Tue, 12 Aug 2003 19:02:12 -0400
Hi,
Is there a problem with NSHomeDirectory and NSOpenPanel? I have this
code:
NSArray *fileTypes = [NSArray arrayWithObject:@"loc"];
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
NSLog(@"%@",NSHomeDirectory());
result = [oPanel runModalForDirectory:NSHomeDirectory() file:nil
types:fileTypes];
when it runs, the NSLog displays the correct info (/users/john), but
when the OpenPanel shows, all it shows is my drives - it doesn't select
my home directory. Even the selections in the popup menu at the top
don't work - selecting Home, or Application, or even a recent folder at
the bottom don't change the window. I can click, one level at a time
and get to where I want. If I substitute nil for NSHomeDirectory(), it
correctly starts in the application's directory. My system (G4) has two
hard drives in it, one is all OS 9, the other is partitioned with my OS
X, and with another small OS 9 partition (that I use for classic). I'm
going to double check, but the same code run on my iBook, which has
only one partition, works fine.
Does runModalForDirectory ignore the directory passed? Or is it
confused by the multiple drives, even though there's only one OS X
partition.
Thanks!
John
_______________________________________________
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.