Re: NSPathControl
Re: NSPathControl
- Subject: Re: NSPathControl
- From: Quincey Morris <email@hidden>
- Date: Tue, 02 Jun 2015 03:25:24 +0000
On Jun 1, 2015, at 17:56 , Graham Cox <email@hidden> wrote:
>
> 4. The control represents a “path” that isn’t anything like a URL, such as a tree node
My point was that NSPathControl apparently constructs URLs out of the path components, regardless of what you’re really representing, and regardless of how you originally configured them. From NSPathControl.h:
> /* Gets and sets the path value displayed. When setting, an array of NSPathControlItems will automatically be set based on the path in the 'url'. If the 'url' is a file URL (returns YES from isFileURL), the images will automatically be filled up with file icons, if the path exists. The URL value itself is stored in the objectValue of the control.
> */
> @property (copy) NSURL *URL;
Note where it says “is stored in the objectValue”. Similarly, in NSPathControlItem.h:
> /* A url for the partial path from the beginning up to this particular item.
> */
> @property (readonly) NSURL *URL;
None of this is a problem, since you should be able to construct a URL out of any array of component strings, with proper escaping. So regardless of your intention, NSPathControl may attempt to classify this URL as one of #1-#3. Your case #4 still produces a URL that is one of those 3 cases.
I was really asking whether NSPathControl can mess up what you and Lee Ann are doing, if you give it an array of components whose titles happen to be [“Users”, “yourname”], for example. In that case, the URL file:///Users/yourname <file:///Users/yourname> really exists — it’s your home directory — and I’m not sure that NSPathControl won’t display this is starting with your home directory icon, and dropping the first component. At least, that’s what I think I’ve seen it do with that URL. Presumably this will not be what you intended, if it happens.
But it’s not that important. If it seems to be working for you, I’m happy to hear it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden