Re: where have all the IVARS gone? (long time passing...)
Re: where have all the IVARS gone? (long time passing...)
- Subject: Re: where have all the IVARS gone? (long time passing...)
- From: Bill Bumgarner <email@hidden>
- Date: Sun, 9 Jul 2006 23:37:51 -0700
On Jul 9, 2006, at 10:53 PM, Vinay Prabhu wrote:
The '< >' symbols I have used to point the class name,
the actual code looks like this,
@interface myClass (Private)
//Private variables
int iVar1;
float iVar2;
These are now declared as global variables and there will be exactly
one "instance" of each available throughout your entire program.
Instantiate more than one instance of [the incorrectly named]
"myClass" class, and all instances will see the exact same values and
storage location of said variables.
//Private methods
- (void)doSomething;
@end
This works perfectly fine, because I have used the same approach to
hide the
private variables in a static library created by me. Where I need to
expose
the .h file.
The static library is up and used in other application without any
problems.
Successfully hiding the private variables.
The only way this would "work" is if you are only ever instantiating
exactly one instance of "myClass". In that case, it would appear to
work until you did something like...
iVar1 = 42;
... in any random source file in your application.
b.bum
_______________________________________________
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