I want to use global variables and objects for the iphone project.
I have created NSobject class and defined like below:
.h File:
#import <Foundation/Foundation.h>
@interface GlobelClass : NSObject
extern NSString *mystr;
extern NSMutableArray *Arrdata;
@end
.m File:
#import "GlobelClass.h"
@implementation GlobelClass
NSString *mystr;
NSMutableArray *Arrdata;
@end
What is the best way Or should I use singleton pattern like below link answer: Using global variables in Objective-C
Please share thoughts?