One Quickie

Renaming "MyDocument" (Xcode->General)
I find the default name "MyDocument" that Xcode uses for new document-based Cocoa apps to be annoying, sounding more appropriate for Fisher-Price toys than professional software. Renaming all of the moving pieces in Xcode can be a bit daunting, and I don't want to edit the project template, since those tend to get revised as time goes on. This is what I do:
  1. make the new project
  2. replace MyDocument with the newDocument name (BWGraphDocument here):
    perl -pi -e 's/MyDocument/BWGraphDocument/g' *.[hm] *.xcodeproj/* *.plist
  3. rename the document files:
    mv MyDocument.h BWGraphDocument.h
    mv MyDocument.m BWGraphDocument.m
  4. rename the nib file:
    mv MyDocument.nib BWGraphDocument.nib
  5. open the nib file, drag in your document header and change the class of the File's Owner to the new class. Delete the MyDocument type.

borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book