Top 10 Annoyances XCode 4 Fixed For Me
Top 10 Annoyances XCode 4 Fixed For Me
Join the DZone community and get the full member experience.Join For Free
XCode 4 is a radically subtle re-think of the XCode interface. The biggest changes are the switch to a single view as well as the overall workflow for running and deploying apps to the App Store.
Here are some of my favorite improvements over XCode 3.
1. Hitting Run while looking at an IB file.
I’ve done this more times than I care to admit. Bring up a XIB, makes some change, and now I want to run the simulator and I hit Command-R and oh wait no but it’s too late. The simulator runs and shows some usually-whacky screenshot of the XIB file. Useless. Now I have to click on XCode and Command-R again.
Probably happens to me twice a day.
With XCode 4, Interface Builder is integrated with XCode and there is no longer an ability to “Run XIB.” Happy news.
2. iPhone Simulator switching to iPad
This has never historically been a problem, but if you’ve used XCode 3 in the last few months, this bug crept in and IS THE RUINER OF LIVES.
Basically, the problem is that for various reasons, some known and some unknown, the default simulator will switch to the last on the list. For example, a couple months ago, I was working on an iPad app and every few runs or so the simulator would switch to iPad. It *always* happened after a clean. What was even more frustrating is that I finished that project, got a new XCode update, and the problem had reversed! So, I found myself doing iPhone work and frequently have the iPad simulator pop up. JEEBUS!
I think this was a secret ploy by Apple to get us all to move to XCode 4. Well, it was a big reason, honestly.
3. Wading through 100 windows.
Several times a day I wanted to look at a specific window I had open, perhaps a certain line was highlighted or perhaps I forgot the filename and just needed to find that particular window. And that’s when you realize you have several dozen windows open. (Project, Console, 6 code windows, search, 2 XIB’s, errors window, ARGGG!!!)
XCode’s new single-view interface keeps things nice and clean, though you can still double-click to open a file in its own window. It especially cleans up Interface Builder, since each one of those files had two of its own!
4. Escape in the middle of code.
This one happened to me a dozen times a day.
Let’s say you have a line of code and perhaps its a call to open a UIAlertView. The arguments have gotten a little munged and you want to see the method’s parameter list again but you don’t want the text inserted into the editor. You move your cursor to halfway in the text “alertView” and hit escape and — nothing. There had to be at least a space after your cursor for it to complete.
Hooray! XCode 4 no longer has that prohibition. Now you can use autocomplete like a handy reference.
5. Using four apps (XCode, Finder, Chrome, App Loader) to release an app.
XCode 4 lets you build and deploy directly from XCode. Thank the freakin’ gods.
6. Constantly losing the IB Objects window.
This drove me batty. Open up a XIB, make some changes. Then, do some code. Come back to the XIB, and 9 times out of 10 the objects window is hidden somewhere. Most times you can click the IB icon in the dock and you get it again, but it as simply obnoxious because it occurred all day.
Again, the single-view interface alleviates this. Sort of. The objects view is collapsable which can be construed as becoming “lost.” The good news is the collapsed view is very handy and saves space. Try it condensed and see!
7. Losing Console output every run.
Ever run an app, get some console output that maybe showed a crash or something. You go to fix it but if you re-run the app, the console clears. i tend to program quickly, so it’s usually not what I wanted. The only way around it was to copy-and-paste the console output, which is way too manual for my tastes.
XCode 4 retains console output for each run. Simply go to the Log Navigator (Command-7, tho I remapped to Option-7) and see all the output for your runs as well as builds! Thanks, Apple!
8. Changing three items just to run a different target.
This one isn’t always a problem, but can sometimes be. In fact, it was so obfuscated, I can’t even strictly remember the naming scheme. Basically, if you had a couple targets in your project, and wanted to switch, you had to change the target *and* … *and* something else. I can’t even remember it was so stupid.
In XCode 4, the schema system is, at first, a little too involving. But, in a short time you clearly see that it’s bundling all these options into one. Very easy to switch targets now!
9. Multi-View Counterparting
I didn’t realize this was a problem until I got XCode 4. In general, when you editing a *.m file and had to change the *.h you’d hit Command-Option-Up. That doesn’t work anymore in XCode 4 and is one of the top annoyances. (Muscle memory is a bitch. They changed it to Command-Control-Up and you can’t switch it back in XCode, you’ll need to remap.)
Now, in XCode 4, the recommended way to do it is to bring up the Assistant with Command-Option-Enter. It will show you the current file’s counterpart. So, if you’re looking at a *.m, it shows you a *.h, and vice-versa.
Now, I keep the Assistant open all the time, in a smaller pane than my main file, and also hide my Navigator (I mapped the key to Option-~) so I have maximal wide-screen space enough to show the *.m and *.h side-by-side. It works nicely, and if I change to a different source file, it loads both for me automatically.
10. A Cleaner Navigator
The old project navigator was too bulky. Aside from your source code and other files you expected to be there, there was also:
- linked projects
- old searches
- products (and this still is, grrrrr…)
Still not sure why Products is still there. So useless. If you want to change anything about the project, executable, targets, etc. simply select the project at the top and a tabbed system will show you. It works great and keeps everything much cleaner!
Published at DZone with permission of John Blanco , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.