So I've discovered an interesting behavior in NSPathControl and am wondering if it warrants a Radar.

I'm building up my own presentation of the file path to be shown in the NSPathControl. Specifically, if the file for which the path is being presented is in some standard location then I'm abbreviating the path. As a simple example, if the file is in ~/Documents/FIle.txt then instead of:

        Users > User A > Documents > File.txt

I will show:

        Documents > File.txt

The approach I'm taking is to pass a payload (an NSArray) to my customization of NSPathControl's setObjectValue. In setObjectValue I compose a string ("/Documents/File.txt") that I pass on to [super setObjectValue:], which sets up the NSPathComponentCells just fine. Then I iterate over the pathComponentCells calling each one's setURL. (And in this example that would be 'file://localhost/Users/User A/ Documents/' for the first cell, and 'file://localhost/Users/User A/ Documents/File.txt' for the second cell.)

Doing this in a forward direction gives the following cell URLs:

        0. file://localhost/Users/User A/Documents/File.txt
        1. NSPathCell://localhost/Documents/File.txt

Say what?

Interestingly, if I do this in a reverse direction I get the _proper_ cell URLs:

        0. file://localhost/Users/User A/Documents/
        1. file://localhost/Users/User A/Documents/File.txt

If this is a bug, I'll be happy to write up a small test app to present the problem.

Mike

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to