Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!rutgers!rochester!pt.cs.cmu.edu!wb1.cs.cmu.edu!avie From: avie@wb1.cs.cmu.edu (Avadis Tevanian) Newsgroups: comp.sys.next Subject: Re: Mach-O sements & Documentation ( was Re: Spirograph..) Message-ID: <4862@pt.cs.cmu.edu> Date: 30 Apr 89 23:25:01 GMT References: <569@hydra.gatech.EDU> <8827@polya.Stanford.EDU> <281@nueces.UUCP> <8850@polya.Stanford.EDU> Organization: NeXT, Inc. Lines: 43 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 --