Questions tagged [private-header]

Private header files are an extension of C header files (*.h) and are sometimes stored in *.r files. It is a term also used to refer to a subset of header files used in C++ or Objective-C programming.

Private header is a concept introduced by Axel Schreiner in his book Object-Oriented Programming With ANSI-C. It extends the idea of C header files, which are stored in *.h files with private headers that are stored in *.r files.

The term also gets used sometimes by programmers using C++ or Objective-C to differentiate different uses of header files in an object oriented context.

7 questions
38
votes
5 answers

Private/public header example?

Can someone please give me an example of how public and private headers work? I have done some reading on the net but I can't seem to find much useful information with sample codes. I was advised that I should use private headers to separate the…
chocobo_ff
  • 510
  • 1
  • 5
  • 14
14
votes
6 answers

What is a "private header" in C?

I've been learning C recently, and in one of my textbooks I found a reference to a file with the ".r" extension. Now, as you can imagine, googling "r" or "file extension r" is not productive, so I wonder if you could help me out. It appears in the…
Ziggy
  • 21,845
  • 28
  • 75
  • 104
2
votes
0 answers

Category in a private header in Static Library not found by Swift app code

I am trying redo an objective C app in Swift, Both the Swift app and Objective C app will use the same static library which is written in Objective C. I have a category inside a private header in the static library. The objective C app has no…
1
vote
1 answer

How can I create private module without including private headers into the framework?

I want to create a private module without including the private headers into the framework. I can compile the framework. But when I add it to the application project, Xcode gives the following error: Umbrella header 'XXX_Private.h' not found When I…
Dmitry
  • 527
  • 5
  • 13
1
vote
0 answers

How do I access a public header from a static library that imports a private header? Recieveing Lexical or Preprocessor Issue

I have a static library project in Xcode where I have utilized the Copy Headers portion of build phases to make only certain classes accessible from another project and keep all other classes from being accessed outside of my static library project.…
0
votes
3 answers

Does naming an instance variable with underscore as a prefix have any side effects in Cocoa (Objective-C)?

Possible Duplicate: How does an underscore in front of a variable in a cocoa objective-c class work? I found that in Apple's frameworks' header files , Apple name instance variable with prefix underscope inside a class interface. like the…
Jimmy
  • 1,094
  • 10
  • 22
0
votes
4 answers

Where should support function declarations go?

I have a .cpp source file with some functions that need to be publicly accessible and some support functions that are only used in this source file. I have been putting the all of these functions declarations in the header file as I personally find…
Daniel
  • 1,239
  • 1
  • 13
  • 24