On Tue, Sep 2, 2008 at 8:45 AM, Richard Good <[EMAIL PROTECTED]> wrote:
> It appears that the line
>>
>> static NSArray* constants = nil;
>
> is only being executed on the first call to the method and being ignored on
> all subsequent calls.
> Could someone please explain why? Thanks.
That's th
On Tue, Sep 2, 2008 at 8:45 AM, Richard Good <[EMAIL PROTECTED]> wrote:
> Could someone please explain why? Thanks.
That is how static is _defined_ to behave. The initialization only
takes place once.
-Shawn
___
Cocoa-dev mailing list (Cocoa-dev@list
First I do appreciate the help. The code suggested below does what I
need it to, but I don't understand something (probably the semantics
of 'static').
I know the constants are set only once as I traced the code but, it
sure seems like they should be set each time the method is called.
I
Le 2 sept. 08 à 16:29, Clark Cox a écrit :
On Tue, Sep 2, 2008 at 12:33 AM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:
Le 2 sept. 08 à 00:13, Steven Noyes a écrit :
On Sep 1, 2008, at 1:38 PM, Jean-Daniel Dupas wrote:
Unlike java, Obj-C does not have the concept of class variable.
Your
On Tue, Sep 2, 2008 at 12:33 AM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:
>
> Le 2 sept. 08 à 00:13, Steven Noyes a écrit :
>
>>
>> On Sep 1, 2008, at 1:38 PM, Jean-Daniel Dupas wrote:
>>
>>> Unlike java, Obj-C does not have the concept of class variable.
>>> Your static variable is a classic C
Le 2 sept. 08 à 00:13, Steven Noyes a écrit :
On Sep 1, 2008, at 1:38 PM, Jean-Daniel Dupas wrote:
Unlike java, Obj-C does not have the concept of class variable.
Your static variable is a classic C variable, and C variable are
not automatically initialized to NULL.
The first time you call
On 2 Sep 2008, at 6:47 am, Richard Good wrote:
So let me rephrase the question How do I create an array of constant
strings such that I have only one instance for the entire class,
or is that just not possible. If its not possible how do you
approach the problem in Objective C.
for exampl
On Mon, Sep 1, 2008 at 1:47 PM, Richard Good <[EMAIL PROTECTED]> wrote:
> I'm trying to create an array of string constants to be used inside the
> Person class.
> So let me rephrase the question How do I create an array of constant strings
> such that I have only one instance for the entire class
On Sep 1, 2008, at 1:38 PM, Jean-Daniel Dupas wrote:
Unlike java, Obj-C does not have the concept of class variable.
Your static variable is a classic C variable, and C variable are not
automatically initialized to NULL.
The first time you call init, relationshipMatch may contains
anything
On Mon, Sep 1, 2008 at 4:47 PM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:
> It will not compile:
*facepalm*
Code written in e-mail, yada yada...
--Kyle Sluder
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests
On Sep 1, 2008, at 11:38 AM, Jean-Daniel Dupas wrote:
Unlike java, Obj-C does not have the concept of class variable.
Your static variable is a classic C variable, and C variable are not
automatically initialized to NULL.
The first time you call init, relationshipMatch may contains
anything
On Mon, Sep 1, 2008 at 11:38 AM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:
> Unlike java, Obj-C does not have the concept of class variable.
> Your static variable is a classic C variable, and C variable are not
> automatically initialized to NULL.
Note, for static variables, this is not true.
Le 1 sept. 08 à 21:18, Kyle Sluder a écrit :
On Mon, Sep 1, 2008 at 2:29 PM, Richard Good <[EMAIL PROTECTED]>
wrote:
What I want is how to use the Java idea of a class static variable
in
Objective C
Because Objective-C doesn't have class variables (as Jean-Daniel
noted), you have to use
Very cogent description, but I'm not trying to access the array from
outside of the class.
I'm trying to create an array of string constants to be used inside
the Person class.
So let me rephrase the question How do I create an array of constant
strings such that I have only one instance for
On Mon, Sep 1, 2008 at 2:29 PM, Richard Good <[EMAIL PROTECTED]> wrote:
> What I want is how to use the Java idea of a class static variable in
> Objective C
Because Objective-C doesn't have class variables (as Jean-Daniel
noted), you have to use a global variable. The "static" keyword in C
mean
Unlike java, Obj-C does not have the concept of class variable.
Your static variable is a classic C variable, and C variable are not
automatically initialized to NULL.
The first time you call init, relationshipMatch may contains anything
and may not be NULL, and so it will never be properly in
16 matches
Mail list logo