I am new to objective-C and working on an app in which there are multiple viewController Files. I need to access Value of variables set in one file to be accessible in other files. How can i implement this.
What i was doing that i created a class Globals.m and declared variables in it.
#import <Foundation/Foundation.h>
@interface Globals : NSObject
@property NSString* firstName;
@property NSString* lastName;
@property NSString* emailId;
@end
My question are: 1.will the above Declaration make these variables retain there values in different files?
- Where should i crete a object of this class which should be accessible in all files.