/dev/trouble
Eric Roller's Development Blog

I have been wondering how to get any pictures onto the iPhone simulator for ages and have thought one would need to sync it with iTunes.

But no, I stumbled over the solution by accident: One simply uses Safari on the iPhone Simulator to navigate to an image and the uses the built-in controls to save it.

Hint: to navigate to an image that you have open in your browser on your desktop, simply drag and drop the image (or the URL) to the iPhone Simulator. The same works for any image in the Finder!

While it is convenient to add applications to the Login Items* list, it is also annoying when it takes ages for all of them to launch before you can do any meaningful work.

(*) In the Settings applications, select Accounts, your account and then the Login Items tab.

It occurred to me that one or the other application does not need to be available at login, but it would be nice to load it later. For instance, I don't use Skype during the day, but more in the evenings to contact my friends. So how about launching Skype at 5 p.m.?

The following launchd specification will do exactly that: launch Skype at 5 p.m. (or when not possible, whenever you log in next time):





        Label
        com.skype.skype
        ProgramArguments
        
                /usr/bin/open
                /Applications/Skype.app
        
        StartCalendarInterval
        
                Minute
                0
                Hour
                17
        


Save this file as ~/Library/LaunchAgents/com.skype.skype.plist (note that the Label must correspond to the file name) and wait for magic to happen when you log in next time...

After having spent half an hour looking for a drawing program for vector graphics on the Mac, it occurred to me that I already had one: Keynote .

Obviously, it is aimed at creating stunning presentations, but there is no reason why it cannot be used for any other kind of drawing. When finished, a drawing can be exported as an image file (JPEG, PNG, or TIFF) or simply grabbed from the screen with a screen shot (just use shift-cmd-4 and draw a rectangle).

Keynote is bundles with all new Macs but it is also available separately from the Mac App Store ($20). This price compares well to other graphics applications like OmniGraffle (standard $100, pro $200).

Trying to update Xcode 4.0.1 from within the Mac AppStore application, I was greeted with this error message:

You have updates available for other accounts Sign in to (null) to update applications for that account.

There exist numerous forum entries on Apple's discussion board on that subject and the recommended solution is to trash the "Install Xcode" application and then to re-launch the AppStore, selecting to re-install Xcode.

I trashed "Install Xcode" but AppStore produced the same message. Relaunched one additional time and it allowed me to update (note: not install). However, when it was finished, there was no new "Install Xcode" in the Applications folder!

It turns out, the AppStore had located and updated a different copy of the software on a separate drive where I had made a backup, even though I had renamed it to "Install Xcode-4.0.1". Its info window revealed that it had been modified and that its version number now was 4.0.2.

Installation from that modified backup worked correctly.

The old backup could be restored from the version that I had put into the trash.

Compiling an application for the MacOX10.4u SDK (with Xcode 3.2.4, GCC 4.2.1) results in this linker warning:

ld: warning: object file compiled with -mlong-branch which is no longer needed. To remove this warning, recompile without -mlong-branch: /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/crt1.o

This is not a critical issue and can be ignored. However, it can also be fixed as shown by an answer from Bernhard Baehr on lists.apple.com:

What needs to be done is to recompile the Csu package which can be found on Apple's opensource archive, e.g. the one for 10.4.11 x86 where the -mlong_branch flag has already been removed: http://www.opensource.apple.com/release/mac-os-x-10411x86 http://www.opensource.apple.com/tarballs/Csu/Csu-71.tar.gz

Then it's just a question of recompiling it:

cd ~/Downloads
tar zxvf Csu-71.tar.gz
cd Csu-71
make RC_ARCHS="ppc ppc64 i386 x86_64"

Then we can replace the (stripped) object file in the SDK:

cd /Developer/SDKs/MacOSX10.4u.sdk/usr/lib/
sudo mv crt1.o{,.org}
sudo strip -S ~/Downloads/Csu-71/crt1.o -o crt1.o
sudo chmod 644 crt1.o