Re: Exposing Methods in a Framework
Re: Exposing Methods in a Framework
- Subject: Re: Exposing Methods in a Framework
- From: David Alter <email@hidden>
- Date: Wed, 31 May 2006 12:34:04 -0700
I'm looking at the Apple Documentation on Dynamic Loading Code
<http://developer.apple.com/documentation/Cocoa/Conceptual/
LoadingCode/Tasks/UsingPlugins.html> In in they talk about having
public and private header files. Private header files are not
included as part of your framework.
Form the docs
"Once you have finished your base class, you should package the
compiled implementation with the header file in a framework for plug-
in developers to use. To build a framework, use Xcode’s Cocoa
Framework project template. Make sure you designate private and
public header files as you intend in the Build Phases > Headers
section of the Target Settings pane."
I have also fond a reference to this in one of the Books I have
("Cocoa Programming" by Angustish, Buck, and Yacktman).
Now this brings up the question of do I have two separate header
files for one object? One is representative of the public entry
points and one that has the private entry points. This is what the
book implies I should do. Can I have my interface definition in two
files? Is there special syntax needed for that?
thanks for the help
-dave
On May 31, 2006, at 4:56 AM, John C. Randolph wrote:
On May 31, 2006, at 2:21 AM, Håkan Waara wrote:
I would find it slightly cleaner by "hiding" your private ivars
inside a category of the class, that you define elsewhere. For
example:
This is what you have in your public header:
@interface ClassForEveryone : NSObject
{
}
...
@end
Then in a private header, you do:
@interface ClassForEveryone (Private)
{
id secretVar;
}
...
@end
Well, aside from not being legal Obj-C syntax, your example above
would have two different instance sizes for the same class.
The way that Apple's frameworks typically hide ivars today is to
just put a pointer with a name like "reserved" in storage
declaration, and then allocate their private storage in their -init
methods.
-jcr
John C. Randolph,
VP, Engineering
Stealth Imaging, Inc. <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden