Tag Archives: Xcode

What I'm missing in Xcode4?

I’m a big fan of Xcode3. Xcode4 is a step in the right direction for me, though. Not so much as it would be when I started with Mac and iOS development, but still, it’s ok.

However, there are large omissions and important bugs that are heavily influencing my productivity.

  1. Removed Right-click, Find In Documentation. (Update on April 1st 2011, 16:42 CET: Alt+left-click is a replacement for this.)
  2. Removed Command+shift+up to switch between header and source. Assistant views are not a replacement since I work on Macbook, which doesn’t have all that much screen real-estate, especially, when you have the File Navigator on the left. (Update on July 12th 2011, 16:21 CET: Use Ctrl+cmd+up, or three-fingers-down-to-up touchpad gesture.)
  3. No ability opening multiple Get Info dialogs on the screen for different project Targets. In fact, Get Info was removed and replaced with (admittedly superior) way of editing build settings.
  4. When autocomplete lists tons of options, Page-down (Fn+Down) does not work. That’s right, you can’t scroll over a screenful of symbols at a time.
  5. Command+shift+b has been reassigned to … get this … Build & Analyze. Ok, that needed a shortcut (maybe), but Command+shift+b used to be the shortcut to open “build progress” output dialog.
  6. Build progress is now assigned a navigator; that is, hit Command+7 to get it. However… the Editor view does not automatically focus on latest build progress and.
  7. Closely related to previous item: there is no obvious shortcut for switching focus between Editor and Navigator. I really want to quickly choose a file, to quickly choose a build log, and to quickly choose an issue from the list. While this is not something that used to exist in Xcode3 (or at least I couldn’t find it) it is still something that would be highly useful. Open Quickly – Command+Shift+O – is not a substitute.
  8. I really miss the old “Groups & Files” view. Not a big deal, but having that as an alternative to the new Navigators view would be excellent.
  9. While autocomplete got even better, Command+doubleclick is extremely dumbed down and cannot guess that in [[NSString alloc] initWithString:@"something"]; attempting to find initWithString in header probably means NSString‘s -initWithString:, right? Well, if you have another initWithString: in another class, Xcode4 will ask you which one you refer to (despite [NSString alloc] being declared to return NSString, thus there being no dillema whose -initWithString: needs to be used).
  10. Despite introducing tabs, they are next to useless: hard to open, and with no obvious keyboard shortcuts to switch tabs or close tabs.
  11. added March 18 2011, 14:12 Oh. Right-click, Add Files to “projectname.xcodeproj” does not take into account parent group path anymore. That means, despite configuring that pesky Window Systems/iOS group to point to path “relative to group” and pointing to “windowsystem/iOS” filesystem folder, Add Files dialog will no longer default to that folder. Meaning I nevertheless have to dig around the filesystem to find the relevant files.
  12. added March 18 2011, 14:40 You can no longer easily access full path to a currently open file by right-clicking on the titlebar. This is important in case error log refers to system-wide installed header file, which you go and happily change without affecting header file that you should be changing — the one in a subproject.

These are just some omissions that significantly reduce my productivity compared to Xcode3. I sincerely hope they will be patched by Apple, otherwise I’ll simply have to do without them. There’s no other way: iOS devs (and to some extent Mac devs) are hostages of the latest SDK which ships only with the latest IDE.

Single Xcode project for iOS and Mac OS X

In Xcode 3.2.4, it’s trivial to create same project for iOS and Mac OS X. Just add a new target into your existing project; if your project is for OS X, then create a new Cocoa Touch Application target. If your project is for iPhone, obviously, craete a new Cocoa Application target. Then do a Get Info on your new target, and choose the appropriate Base SDK. For simplicity, let’s presume you’re adding an OS X target to an iPhone project.

However, after doing this, you’ll quite probably find that despite the choice of Base SDK in your target (you used Get Info on it, didn’t you?), Xcode has locked the target SDK onto whatever your project originally used. That is, now you’ll find it locked onto iPhone, despite switching to the OS X target using the Overview dropdown (in the top left of your Xcode project).

So how do you actually switched the now-locked SDK? Quite simple. Hold the option key while clicking in the Overview box. Instead of only two-entries device list (if you have an iPhone target selected), and then Active Configuration, Active Target, Active Executable and Active Architecture, by holding the option key while clicking on Overview you’ll also find the Active SDKs list. By switching it to the appropriate OS, you’ll be able to compile the application.

Of course, now comes the hard part: actually porting the code to the new platform.
E49PEQSG669E