Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

2178965

Cancelled
Original poster
Jun 21, 2009
82
17
Hello folks,

My goal is to organize the source files that comprise my project into "packages" in the sense of Java packages. The Objective-C manual (page 41) indicates that the language supports a @package compiler directive. But the manual doesn't explain packages beyond that!

So, my questions are:

1) What is an Objective-C package?

2) Should I organize the source files in my project by package, assuming Objective-C packages are similar to Java in regards to visibility.

Thanks in advance.
 
My goal is to organize the source files that comprise my project into "packages" in the sense of Java packages.

You can't. See Luke Redpath's stack overflow link above. It describes the common technique of using "namespace" prefixes on class.

The Objective-C manual (page 41) indicates that the language supports a @package compiler directive. But the manual doesn't explain packages beyond that!

@package is used in Objective-C in the same way as @private and @public is used, which are used in the same way a Java's private and public, but for instance variables only, not for methods.

However, @package bears no relation to Java's package in this context. The Objective-C Runtime Release Notes for Mac OS X v10.5 describes what @package means.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.