Simply Create a singleton class similar to this... i.e if you are using ARC.
MyGlobalData.h
@interface MyGlobalData : NSObject
{
NSMutableArray *myData;
}
@property (nonatomic, retain) NSMutableArray *myData;
+ (id)sharedManager;
@end
MyGlobalData.m
@implementation MyGlobalData
@synthesize myData;
+ (id)sharedManager
{
static MyGlobalData *sharedData = nil;
@synchronized(self)
{
if (sharedData == nil)
sharedData = [[self alloc] init];
}
return sharedData;
}
- (id)init
{
if (self = [super init])
{
myData = [[NSMutableArray alloc] init];
}
return self;
}
- (void)dealloc {}
@end
Your Scene A Controller
-someMethod()
{
MyGlobalData *sharedObject = [MyGlobalData sharedManager];
}
Your Scene N Controller
-someMethod()
{
MyGlobalData *sharedManager = [MyGlobalData sharedManager];
}
Note: You can also use GCD in sharedManager but I'll leave it to you. Figure it out. Also this implementation will be bit different if you are not using ARC in your project.