I had some discussion related to the use of properties and instance variables at work, therefore I would like to find a wiki answer for that. Now, I know there\'s no real pr
Similarly to C++, Objective C provides public, private, and protected scopes. It also provides a package scope which is similar to package scope as defined in Java. Public variables of classes can be references anywhere in the program. Private variables can only be referenced within messages of the class that declares it. It could be used within messages that belong to ANY instance of the same class. Package scope is similar to public scope within the same image, i.e. executable or library. According to Apple’s documentation, on 64-bit architectures, variables of package scope defined within a different image are to be treated as private. Variable scope is defined by @public, @private, @protected, @package modifiers. These modifiers can be used both in a way similar to C++ or Java. All variables listed under a scope declaration belong to the same scope. Also, variables can be listed on the same line where the scope is declared.
@interface VariableScope : NSObject {
@public
int iVar0;
@protected
int iVar1;
@private
int iVar2;
@package
int iVar3;
@public int iVar01, iVar02;
@protected int iVar11, iVar12;
@private int iVar21, iVar22;
@package int iVar31, iVar32;
}
@end
For more info use the below link
http://cocoacast.com/?q=node/100