RE: Exposing Methods in a Framework
RE: Exposing Methods in a Framework
- Subject: RE: Exposing Methods in a Framework
- From: Vinay Prabhu <email@hidden>
- Date: Wed, 31 May 2006 15:44:09 +0530
- Importance: Normal
Hi,
You can even use the @private Directive to
hide the instance variables.
use @public directive to expose the variables you want
-----Original Message-----
From: cocoa-dev-bounces+vinayprabhu=email@hidden
[mailto:cocoa-dev-bounces+vinayprabhu=email@hidden]On
Behalf Of Hakan Waara
Sent: Wednesday, May 31, 2006 2:52 PM
To: David Alter
Cc: email@hidden
Subject: Re: Exposing Methods in a Framework
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
31 maj 2006 kl. 00.55 skrev David Alter:
> I have a framework that other developers will use. In it I want to
> expose specific methods but not necessary all the instance
> variables and methods. I was looking for the preferred way of doing
> this with obj-c. I was planning on using a sub class and having the
> subclass .h in my framework header folder.
>
> For example here are two classes. The class ForEveryoneToSee does
> not expose my instance variables. My framework would have this in
> the headers folder. It would not have the .h for ForMeToSee. Is
> this the preferred way of doing this? It seams like there should be
> a cleaner way to do this.
>
> @interface ForEveryoneToSee : NSObject {
>
> }
> -(NSString *) myData;
> -(void) setMyData(NSString * )inData;
>
> @end
>
>
> @interface ForMeToSee : ForEveryoneToSee {
> NSString * _myData;
>
> }
> -(NSString *) myData;
> -(void) setMyData(NSString * )inData;
>
> @end
>
>
> thanks for the help.
>
> -dave
>
> _______________________________________________
> 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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
in
This email sent to email@hidden
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s)and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender or 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