A "token" will be given upon authentication in a form of xml file with some other elements.
I managed to extract the token, and display it in the calling class, let's say parser.m.
However, I need to make the content of that variable available globally, so that I can reuse the same token. How do I do that?
Please note that a different token will be given upon the next authentication.
.h:
@interface Parser : NSObject <NSXMLParserDelegate>{
NSXMLParser *parser;
NSMutableString *element;
NSMutableString *token;}
@property (nonatomic, retain) NSMutableString *token;
@end
.m:
#import "Parser.h"
NSLog(@"tOKEn called from main: %@", parser->token);
It is not able to access the "token" that was declared under parser.m
How do I go around this?
Update 1: I found out that using @public serves the purpose too. Not sure whether its a good move or not since I will be needing the token in all my API calls.