On Apr 10, 2008, at 12:42 PM, vance wrote:
Yes that works but then it becomes a global variable.
I was wondering if ObjC can handle static member variables. If not I
will have to hack it up and declare the variable outside of the class
A C++ static member variable is a global variable too, i
On Apr 10, 2008, at 4:08 PM, Scott Ribe wrote:
Yes that works but then it becomes a global variable.
Not when it's declared static. As in plain C, static variables are
at file
scope.
If you really want to access it via instances of the Objective-C
class (or
the class itself), you'll just
> Yes that works but then it becomes a global variable.
Not when it's declared static. As in plain C, static variables are at file
scope.
If you really want to access it via instances of the Objective-C class (or
the class itself), you'll just have to implement an appropriate method to
return it,
On Apr 10, 2008, at 12:48 PM, j o a r wrote:
No, ObjC doesn't have any support for static member variables.
Btw. For ObjC I think it would be more appropriate to call them "class
variables".
j o a r
___
Cocoa-dev mailing list (Cocoa-dev@list
You'll need to move the declaration outside the interface. You can
stick it in the .m file for that class like you can with C/C++.
On Apr 10, 2008, at 1:29 PM, vance wrote:
Does ObjC supports Static Member Variable, and if so, how do you set
it?
The getter function gets a compile time er
On Apr 10, 2008, at 12:42 PM, vance wrote:
Yes that works but then it becomes a global variable.
It's static, so it's local to the module being compiled.
I was wondering if ObjC can handle static member variables. If not I
will have to hack it up and declare the variable outside of the cl
On Apr 10, 2008, at 1:42 PM, vance wrote:
Yes that works but then it becomes a global variable.
I was wondering if ObjC can handle static member variables. If not I
will have to hack it up and declare the variable outside of the class
Yep, that was the answer I got from several sources when
: cocoa-dev
Subject: ObjC static member variable
Does ObjC supports Static Member Variable, and if so, how do you set
it?
The getter function gets a compile time error. In C++ we do
MyObject::staticObject to return the static member variable but I am
not sure how is that done in ObjC
Ex
: Thursday, April 10, 2008 3:30 PM
To: cocoa-dev
Subject: ObjC static member variable
Does ObjC supports Static Member Variable, and if so, how do you set it?
The getter function gets a compile time error. In C++ we do
MyObject::staticObject to return the static member variable but I am
not sure how
Does ObjC supports Static Member Variable, and if so, how do you set it?
The getter function gets a compile time error. In C++ we do
MyObject::staticObject to return the static member variable but I am
not sure how is that done in ObjC
Ex:
@interface MyObject : NSObject {
s
10 matches
Mail list logo