swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective C


From: Nelson Minar
Subject: Re: Objective C
Date: Sun, 4 Feb 96 18:12:50 MST

>I'm having a little trouble with OC syntax.  In C++ there is
>a way to define variables that are common to all members of the class.

This is one of the biggest frustrations in Objective C - no class
variables. The standard way around this for now is to make a variable
with static scope in the .m file for the class, then let the class
methods access it.

The variable "hotBondProbability" in apps/bondblocks/BondingBlock.m is
an example of this. I didn't actually declare this static, so it's
really just a global variable. If you add a "static" in front of it,
then the variable is scoped to only be visible inside that .o file


reply via email to

[Prev in Thread] Current Thread [Next in Thread]