[comp.sys.next] Mach-O sements & Documentation

chari@nueces.UUCP (Chris Whatley) (04/30/89)

In article <8827@polya.Stanford.EDU>, ali@polya.Stanford.EDU (Ali T. Ozer) writes:
> You
> can now include .nib files (and any other data file you might need)
> in Mach-O segments of your executable. It's very easy to open a stream
> bound to data stored in a Mach-O segment; thus you can read any random
> data from the executable itself. Of course, there are "convenience" 
> methods such as "loadNibSection:," "newFromMachO:," provided to
> make it real easy to read common forms of data (such as .nib files,
> TIFF bitmaps, sound data, etc) out. 

Does this mean that "ResEdit" capabilities could exist in Interface Builder
so that I could edit the icon that was included as a segment in my program
without having to recompile? I hope Apple doesn't have "resources"
copyrighted. :-)

Re: Library

When, if ever, will it be unnecessary to purchase the massive binders of
documentation that you need to program the NeXT effectively? I only really
need bits of the References at my fingertips since my university has
copies available in it's computing library.

Can I expect Objective-C documentation, DPS manuals, correct man pages :-) ?

If there is one thing that I love about this system, it is the on-line
documentation and to a certain extent, the Librarian (the limited appreciation
of the Library has to do with its current beta state). I can't imagine
getting around this system and learning how to program it using 
"man -k" (If you haven't guessed yet, I had not yet been introduced to
the headaches of Unix administration when I got this machine though I have
been using Unixes since I was about 15). It would be really great if
NeXT put *all* of the documentation on disk so that I could read it on the
screen or print stuff out to read in my easy chair if needed.

Chris


-- 
Chris Whatley                              |   "Thank you..
!bigtex!nueces!chari@cs.utexas.edu         |    Ah.. Thank me!"
chari@walt.cc.utexas.edu		   |        --Data
1607 Nueces,Austin TX 78723 - 512/453-4238 |    

ali@polya.Stanford.EDU (Ali T. Ozer) (04/30/89)

In article <281@nueces.UUCP> chari@nueces.UUCP (Chris Whatley) writes:
>In article <8827@polya.Stanford.EDU> I say:
>> You can now include .nib files (and any other data file you might need)
>> in Mach-O segments of your executable. 
>
>Does this mean that "ResEdit" capabilities could exist in Interface Builder
>so that I could edit the icon that was included as a segment in my program
>without having to recompile? 

The data in the Mach-O segments is read-only and cannot be edited. (I'm 
not sure if you can edit it without changing the size; that'd be all you need
to in most cases. Avie? Actually Interface Builder does not let you edit
a .nib file that's been put into an executable anyway.)

There is however another way to include .nib files with your
application: Through app wrappers. You'd do this if you wanted your
data and .nib files available seperately from your executable, but
with the convenience of having the user deal with just one icon. If
your program is called "Foo," you create a directory named "Foo.app,"
put the Foo executable and all your data files in the directory.  When
user sees the directory Foo.app in the browser, they see a file, not a
directory. When they move it, copy it, etc, it behaves like one file.
When they "open" it (double-click on it), Workspace Manager launches
the "Foo" application in the directory.

There are ways to get in the directory; "Open Directory" in the Workspace
Manager menu lets you see the contents. You can get to it through the shell.
You can also get to it through the standard file requesters.

This capability exists in 0.8, by the way; check out the DSPMusic demo
in the demos directory.

>Re: Library
>
>Can I expect Objective-C documentation, DPS manuals, correct man pages :-) ?

0.9 does come with a lot more of the documentation on line than 0.8 does.
However, the Obj-C documentation and the Adobe DPS manuals aren't online
in 0.9.

Ali Ozer, NeXT Developer Support
aozer@NeXT.com

avie@wb1.cs.cmu.edu (Avadis Tevanian) (05/01/89)

In article <8850@polya.Stanford.EDU> ali@polya.Stanford.EDU (Ali T. Ozer) writes:
>In article <281@nueces.UUCP> chari@nueces.UUCP (Chris Whatley) writes:
>>Does this mean that "ResEdit" capabilities could exist in Interface Builder
>>so that I could edit the icon that was included as a segment in my program
>>without having to recompile? 
>
>The data in the Mach-O segments is read-only and cannot be edited. (I'm 
>not sure if you can edit it without changing the size; that'd be all you need
>to in most cases. Avie? Actually Interface Builder does not let you edit
>a .nib file that's been put into an executable anyway.)
>

Mach-O segments are generally thought to be read-only for two reasons.
First, because they are part of the executable, and its not very nice to
edit executables that may be running.  Second, because it tends to be
difficult to rearrange data in them when sizes and positions change
(this is the job of ld).  So, after editing a nib file, or changing a
TIFF icon, or whatever, all you need to do is relink (run ld).  It
is possible to change InterfaceBuilder to try to make changes in place
(perhaps by allocating more space then needed ahead of time, for expansion
of the nib file(s)), and with some other improvements, but we haven't
done this yet.

>There is however another way to include .nib files with your
>application: Through app wrappers.

App wrappers are a feature that should be avoided if possible.  My
general guidelines are as follows:

1) While developing, keep your .nib file separate from the binary, in
the directory with your sources.  Interface Builder will edit it directly
and you can test your program without recompiling.

2) When you release your app, combine the .o's, .nib files, images, etc.
into one Mach-O binary.

3) If you can't put everything in the Mach-O binary, then just use an app
wrapper, but use and app wrapper as a last resort.
-- 
Avadis Tevanian, Jr.    (Avie)
Chief Operating System Scientist
NeXT, Inc.
avie@cs.cmu.edu or avie@NeXT.com
--