How to reset the Recent Files Only filter in Xcode 4? - iphone

The Project Navigator has this nifty filter at the bottom (icon with a clock). When you click it, it only shows the files which have been edited recently.
Problem: There seems to be no way to reset this. My project has nearly 200 source files and I use a lot of them from day to day. So this list is getting bigger and bigger, and therefore less useful over time.
Often I am just done with something and then I'd just want to get rid of these files in the recents filter.
Is there a secret way to reset the filter? Xcode4 must store this information somewhere.

Navigate into the .xcproject or .xcworkspace package using the terminal or open package in Finder. Clear the contents of the <username>.xcuserdata folder.

I had this problem today, and apparently Apple fixed the bug. Just click on the clock icon again to toggle.

For me, restarting Xcode (I'm using 7.2) reduces the number of files shown when the "recent files" filter is on. But I don't know how the files that still remain are determined.

Related

Show last date modified in VS Code

Is it possible to show the last modified date for each file and folder in the Explorer window of VS Code? If it's not possible by changing the settings, are there any extensions that do this?
I use macOS but am interested in solutions on macOS/Windows.
I'd like to jump in with a link to the best solution I found so far (and a link to the original repository, in case the link to marketplace changes).
But the ultimate solution (I think) would be to show that info in the status bar - I will hopefully remember to update this answer if I ever come across such a solution!
I use the VS Code filesize extension. It shows the size of the file in the bottom status bar. If you click on this size figure you will immediately see a table with the date of file creation and the date of the file update like the following:
There appears to be a whole array of extensions available nowadays, for such matter:

(Xcode 6) - Code completion not work (UIKit, Foundation...)

I need help with Xcode 6.
It only happens with the project I'm working with. For the other one, code suggestion works.
What's wrong with my project?
The answer was to delete ~/Library/Developer/Xcode/DerivedData/ModuleCache (while Xcode is closed)
I have been researching the same issue on StackOverflow and here are what most threads suggest: delete Derived Data folder files (or maybe just the files relevant to your troublesome project!). It worked for me hence this answer. Details below:
Fix manually by deleting all the files in ~/Library/Developer/Xcode/DerivedData
Note: If Library folder is new to you, follow this CultOfMac article:
Library access on.
Open a Finder window and then navigate to the Home folder. That’s the one represented by the cute little house icon over in the sidebar. If you don’t see it, click on something like the Desktop or Documents folder, and then Command-click on the title bar of the window. You’ll get a drop-down menu that shows the file path of the current folder, which–if you’ve picked a folder from your Home directory–will show the Home folder somewhere in the list. Click on it to go to the Home folder.
Now, once you’re there, hit Command-J to bring up the View Options panel. You’ll see a checkbox to “Show Library Folder” somewhere in that panel, depending on the view your Finder window is in. Simply check it to show your User account’s Library folder. Now you can go in there and mess around to your heart’s content.
Note: Some StackOverflow members suggested pressing 'Escape' key or Command and + keys after the dot (.), others suggested typing a white space (control+space bar). However, your post seems to suggest it's project-specific (works for the other project) so it may prove useful to try different approaches. Hope this helps.
Swift files will NOT have code completion for UI classes (e.g. UIImage, UIDevice) unless there is an "import UIKit" at the top of the file.

Why is my XIB modified every time I open it in IB?

I click on the XIB via the project navigator. It opens up and immediately changes the icon to gray showing I have unsaved changes. If I save changes, click on a different file and click back to re-open it, more changes. Always modifies on open.
It happens with one XIB file in this project and a couple in another project. I'd love to know why it's happening and what I can do to fix it now and prevent it in the future.
Note: using Xcode 3.2 Build 4C199 with Snow Leopard
Edit: I've added a couple sections which got removed from the XML on one of these open/modifications
<key>outlets</key>
<dict>
<key>addEventTabBarController</key>
<string>UITabBarController</string>
<key>window</key>
<string>UIWindow</string>
</dict>
<key>superclass</key>
<string>NSObject</string>
and
<key>outlets</key>
<dict>
<key>courseTableCell</key>
<string>UITableViewCell</string>
</dict>
<key>superclass</key>
<string>UITableViewController</string>
I wound up submitting this issue to Apple. Their response was unenlightening, and talking about possible optimizations, updating meta data for new version of Xcode and the like.
I tracked 100 versions from clicking off and on the file. As Apple said, it was "optimizing" every time, but each time it simply moved some XML tags around. Never happy with it's own optimizations it moved them around the next time they were opened. I'd consider it a bug with Xcode, annoying, but mostly harmless.
This only happened with old XIBs and either moving the contents into a new XIB file or (what really happened) Storyboards got rid of the issue.
I did not want to use storyboards as suggested in one of the other answers.
Here is an alternative simple/quick fix.
Go to the Interface Builder Document Properties on the inspector when selecting the xib view file.
Then you need to
change "Deployment" to something different from Project SDK, in my case I set it to the latest iOS version (iOS 6 currently).
change the development to something different from "Previous version", in my case I set it to the latest Xcode version 4.5
I run Xcode 4.5.2 on Lion.
Hope this helps.
basic Idea...
XCode stores lots of version numbers of all different sorts of things. If you look at the XML representation of the XIB, you should find that the vast majority of these little changes are in these version numbers.
How it happens...
Whenever you do an update of Xcode, many different things within Xcode (and often inside the SDK) get updated. If you make a change to a XIB file, those version changes get stood in the XIB. So, if you happen to open a XIB file, the version changes get put into that file. As soon as you build or run the app, those changed get saved to the file.
But I haven't update Xcode in a while!
Well, whenever you did your last update, the XIB files will be updated with the new version numbers as you open them, one-by-one over time.
Edit XCode 4 is better now, (maybe), if you're tempted to vote this down then ask yourself, "Have I migrated from XCode 3 to XCode 4 using Versioning?" If no, then you have no idea what you're doing, and please don't vote on this. If you have, you know how bad you suffered, but yes this question is otherwise dead. If you do find yourself opening a legacy project, just recreate it and copy the files.
I don't know the exact answer, but I do know these things will help you find it:
XCode 4 is notorious for screwing things up.
If you put your directory into a Versioning system, (Git), then grab GitBox and save your project to give it a state and create a git repo out of it. The git repo will save the state. Gitbox will visually show you the changes.
After opening it, you'll be able to right-click on that file in GitBox and hit "see difference" or "view changes" or whatnot.
You will be auto-scrolled to the lines. If you can relate the XML to the Xib, you can figure out what changes.
I went from Lion to Snow Leopard, so I don't deal with this anymore.

Files missing in XCode 4 Project Navigator after archiving

I'm currently trying to create version 1.1 of a project I created in XCode 4, but after archiving the files do not appear in the Project Navigator. My initial thought was that I had to clone my repository (git) and thus create a new version in which I could see the
files, but the clone is also missing the files.
I can access the files from the top bar, but that's not really a desirable solution when
working with a big project. The case is the same for another project that I have archived
so I suspect it is supposed to be a feature of XCode 4.
What am I missing here?
(I'm just combining your "nevermind, I found it" comments into an answer, to maintain the SO style, so this question doesn't pop up as needing an answer.)
Check that you're not filtering file names (left column, bottom.)
Also make sure you haven't pressed one of the "show only files with..." toggle buttons (same location, near the search entry.)
Note that these buttons are toggles
Yes. I had to hit the X button with the icon that was blue at the bottom. This corrected my issue for XCODE Version 6.1. Thanks.

Xcode's Refactor menu is always disabled

For some reason Xcode's Refactor is always disabled. I used to be able to activate it via selecting a class name and right clicking in the editor to select it. But now no matter what I do, it remains disabled. Any idea what's going on?
Working with Xcode 5, I kept getting "Can't refactor during indexing" when trying to refactor. Rebuilding the index seemed to hang at "Indexing - Waiting for make" forever.
I then noticed that make was already used by another process on my machine (not by Xcode). Shutting this process down enabled Xcode to finally finish indexing
Your project's index might be out of date/corrupt. In the General tab of the Project Settings window, click Rebuild Code Index and wait until it's done.
You can check the progress of the rebuild in the Activity window (Window > Activity).
I just ran into a similar problem in Xcode. I could not refactor anything in the class's .m (implementation file). The only explanation I could come up with is that it was not indexing the file for some reason, and I could not force it to reindex. The only hack that I found that worked was to copy the file to temporary location, remove it from my Xcode project, copy the file from the temp location back to my project's location, and then re-add the file via Xcode.
None of these suggestions work for Xcode 3.2 - the ONLY way is to select the file you want to rename in the left Groups & Files column. THEN highlight the name of the .m or .h in the right code view, then you can right click and select Refactor!
For instance if you're changing the DetailViewController name, highlight the actual DetailViewController.h word in code.
Note, you should also always make sure you've selected the .h file, not the .m
I faced the same thing in Xcode 11. and this worked for me:
I changed iPhone 8 simulator to generic iOS Device and it worked when it is on Generic
I'm new in iOS development,I have met this similar problem.
Xcode:Version 7.1 (7B91b),it looks like Refactor not working:
But when I put my mouse on the red circle point in the following picture,and then the Refactor working.
I think this is a low level mistake,but may be a reference for someone.