Possible Duplicate:
How to use global variables in Objective-C?
I want to know how can i define global variable in Objective-c?
Possible Duplicate:
How to use global variables in Objective-C?
I want to know how can i define global variable in Objective-c?
You might want to check the definition of singleton.
There are two approaches:
(Well, actually 2.5, since simply using a static variable is a more primitive version of singleton.)
You should create a header file like
// Constants.h
extern NSString * const Constant1;
extern NSString * const Constant2;
You can include this file in each file that uses the constants or in the pre-compiled header for the project.
You define these constants in a .m file like
// Constants.m
NSString * const Constant1 = @"FirstConstant";
NSString * const Constant2 = @"SecondConstant";