Re: Help with my stream object please
Re: Help with my stream object please
- Subject: Re: Help with my stream object please
- From: Andy Lee <email@hidden>
- Date: Mon, 10 Oct 2005 12:05:26 -0400
On Oct 10, 2005, at 11:44 AM, Mark Williams wrote:
The downloader class is actually about 10 pages long printed so
it's too big to post here.
I have a questions. Ok I did not declare most of my variables in
the header file. I declared them at the top of the class file
before the @implementation line. Is this why they are being shared
between instances?
Yes. You didn't declare them as instance variables, but as top-level
variables (the technical term for which eludes me -- global?).
Each instance has its own storage for instance variables and does not
share it with other instances. That's why they're called instance
variables. When a method refers to instance variables, its referring
to the storage allocated for the particular instance that is
executing the method at the time.
The variables you declared occupy one location in memory for the
duration of the application. There is only "one of them." Your
methods can refer to them, but they are all referring to the same thing.
--Andy
_______________________________________________
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