I have an NSTableView containing representations of files. I am able to drag these to the Finder with NSDragOperationMove or NSDragOperationCopy and it works fine. The files are correctly moved (even across volumes) or copied.
When dragging with NSDragOperationMove, I'd like to know the parent folder of where the files were dropped in Finder so I can update the paths/bookmarks of the representations I keep internally.
How can I get Finder to tell me where the files were dropped?
Related
When I go to save as a new file, all the files listed in the Finder window are grayed out (folder names display normally). I want the file names to be black too.
This may have happened because of a script I ran on my Mac years back. It may have been one that allowed to see a file kinda 'flying' when I dragged it from one finder window to another and it grayed out the list of Finder file names as the move was happening until the move was complete.
Anyway, after several OS upgrades, now the file names are permanently grayed out – but only when I try to save a file. grayed out file names
Is there any way to get my file names back to display normally?
As far as I know, every directory within OSX contains a .DS_Store (Desktop Service Store) file.
Recently, I had some issues with an application and noticed that it's preferences folder (in ~/Library/Preferences/<appname>) somehow had no .DS_Store in it. The application issues stopped when I created a new Preferences folder with the original content. I could still browse, edit, and access the original DS_Storeless folder.
I want to know what a folder without a .DS_Store file in it means to OSX, and if possible how such a thing can actually happen?
Nothing special. The .DS_Store file is created by the Finder to store settings for that directory, e.g. the size of the window, the display mode, and the positions of icons in the window. It is not created for directories that haven't been viewed in the Finder, or which haven't had any changes made to their display settings.
Whatever problems you had were unrelated.
I've just started using Xcode and discovered that folders are mixed with files of the same level alphabetically.
Is there a way to have folders displaying on top and then files of the same parent folder? Just like in TextMate's FileBrowser.
Current displaying is:
I want it to be:
Thanks in advance.
Changing the MacOS Finder preferences will cause XCode to also display folders before files at the same level.
Find and check the checkbox under Finder -> Preferences -> Advanced labelled Keep folders on top: In windows when sorting by name.
Restart XCode and you will find the new sort order is honored.
Just mouse-down on an item and move it. The file or folder level can also be changed this way. You can make folders from the menubar :File:New:Group".
I see that you are using folder references, not groups. If there is no specific reason to use folder references then change to use groups. When dragging in a folder of files there is the option of folder references or groups. Since folder references are a mirror of the directory structure and can not be changed in Xcode. I suspect the OP really wants groups.
When you are at the very bottom you can drag horizontally to select the level to move to. See added image.
I am making an OSX Cocoa application in Xcode. I want to have a panel on the left side of the app that displays a clickable list of the files in the given folder and when the user clicks on one that file should open in a NSTextView on the right side of the app. I have figured out how to open, save and write to the files in the given folder, but I am at a loss for how to make a selectable view with file names.
I was thinking about using an OnClicked method for file opening.
Also, I do not want to use the OpenFile drop down panel, I want the files to be shown on the screen.
You should use NSOutlineView to display the list of files. You can populate it by iterating through the filesystem with NSFileManager.
Then, when the outline view's selection changes, you can read the contents of the file and set the NSTextView's string property.
I zipped up my project folder in xcode and moved it to a new computer. When I open up the project it has missing files (file appears red).
How can I add all these files back or re-link them. It is like 20+ files?
Why didnt xcode store the relative path?
Xcode may not update location for some files of your project when you copy/move it from one environment to another. The easiest way I found is something like this:
1-Select your files like this, if they are in different groups, then repeat the flow on each group separately:
2- Show the file inspector:
3- You may notice Xcode has an absolute path for them, which is something not useful, so click on the little icon near Multiple Values. navigate to the folder where your selected files are stored in the finder and click "Choose".
Also, don't forget to change the Location to Relative to Project. Now you will get something like this:
• Select all the missing files that are in one folder in Finder.
• Change Location to Relative to Group ( that's in the File Inspector View -> Utilities -> Show File Inspector )
• Click the choose file button; it is under the Location drop down menu; it is an image that looks like a very small window with a document inside it.
A Choose folder containing the selected references sheet should appear.
• find and select the folder containing the missing files in the finder, then click Choose
(Tested in In xCode v4.3.2)
I normally keep all my files related to the project inside one folder (nested where necessary) and yeah I frequently exchange project files (zip and move) with my peers and nothing like that has ever happened to me.
You can always just drag the files en masse back onto the XCode window, and they'll get re-added. If you have file-system folders that match your Xcode internal organization that makes it even easier.
The UI has changed. In Xcode 10, there's a tiny dot with an arrow in it next to the file path. This does nothing as far as I can tell.
There's an obscure folder icon offset up and to the right of that non-functional arrow... this actually is a button, and it DOES allow you to relink the file.