Although NeXTSTEP 3.0 promises binary compatibility with NeXTSTEP 2.1 applications, developers have a little work to do to get their 2.1 applications to recompile in the new OS. Once you've done the conversion, you'll be rewarded with smaller and cleaner code that compiles faster.
Stop! Before you do anything, make backups of all of your existing source directories. Once you open a file with 3.0's Interface Builder (IB), you won't be able to open it again with the 2.1 version.
Choose a program to convert and double-click its IB.proj file. Project Builder (PB) will start up and convert IB.proj into PB.proj. The new program takes over all of IB's project-management functions, like maintaining the Makefile, making the new IB simpler and cleaner. The .nib files will be automatically converted when you edit them.
To create a new project, follow these steps:
1. Launch both PB and IB.
2. Make a new file by pressing Command-n in IB.
3. Save it in a new directory with the same name as your app.
4. Edit your .nibs by double-clicking their names in PB's browser.
5. New classes will be automatically added to your project as you create them inside IB.
You can also precompile your own headers, which avoids having to #import 15 or 30 different files and speeds compiling as well. For Stone Design's 3DMan, I created this ProjectIncludes.h file:
// System include ?????files #importThen I added these lines to my Makefile.preamble file:
#import #import <3Dkit/3Dkit.h> // Your commonly needed objects: #import "cFunctions.h" #import "localization.h" #import "SDLibBundle.h"
# name of precompiled header created: $(OFILE_DIR): 3Dincludes.p # set this to the path where the includes live FILEPATH = /Net/blackhawk/Projects/3Dman # the makefile command 3Dincludes.p: $(PSWFILES:.psw=.h) $(CLASSES:.m=.h) $(HFILES) cc -precomp $(CFLAGS) $(FILEPATH)/3Dincludes.h
/NextDeveloper/2.0CompatibleHeaders/cthreads.h:1: warning: Compatibility file included, useThe way around this problem is to comment out all of the #include and #import statements in your code and replace them with a single #import
Fortunately, there are two simple workarounds. Either change all of your .c files into .m files, or include this line in your Makefile.preamble:
CFLAGS = -ObjC
For example, if you want to get an NXImage for a file icon under NeXTSTEP 3.0, you can simply do this:
image = [[Application workspace] getIconForFile:fileName];Andrew Stone is president of Stone Design.