• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Renaming source files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming source files


  • Subject: Re: Renaming source files
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 30 Aug 2002 07:31:49 -0700

On Thu, 29 Aug 2002 21:48:29 +0100, Jeremy Dronfield
<email@hidden> said:

>This is as much a ProjectBuilder question as a Cocoa one, but I thought
>I'd try here first.
>
>I want to use multiple targets in PB in order to build multiple versions
>of my application. The app uses 11 source/header file pairs, and 10
>nibs. Of these, all files stay the same in all versions, except for one
>source file (SRControls.m) and one nib (MainMenu.nib). So, I'd like to
>be able to create alternative versions of just these files to include in
>each target. Of course, PB won't accept files with identical names, so I
>tried changing the name of SRControls.m to SRControlsAA.m. (I didn't
>change the name of SRControls.h, because I only need the one version of
>it. Also, it's #imported in most of the other source files, so renaming
>it would be inconvenient.) The app built and ran okay, but is this an
>"approved" way of doing things? So long as the file is -@implementation
>SRControls- does it matter that it isn't called SRControls.m?

Actually this is a C question. The names of files are completely
unimportant except for the use of #import (because this speaks directly of
a file name). You don't need source/header file pairs, they don't have to
have paired names, their names need have nothing to do with their contents.
All of that is mere convention for the convenience of you, the human, so
that you can find your stuff and write #import statements coherently. You
could put all the code in one big file and call it zorky.zorky; it wouldn't
matter. The compiler just compiles all the files it sees. The way it sorts
out the information coming at it is by means of the @implementation/@end
and @interface/@end structures it encounters. m.

PS (Of course I deliberately pass over C static globals, whose namespace is
the containing file.)
--

matt neuburg, phd = email@hidden, http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Executing A Shell Script...
  • Next by Date: Re: Executing A Shell Script...
  • Previous by thread: Renaming source files
  • Next by thread: Re: NSURL Access
  • Index(es):
    • Date
    • Thread