I have a method that takes an NSDictionary from a ViewController and assigns it to a global NSDictionary (cardDictionary) variable in my RequestModel class. cardDictionary is declared as a property (nonatomic, retain) and it is synthesized. That works ok (as verified by NSLog). Here it is:
-(void)findIndexForCardPage:(NSDictionary*)dictionary {
//parse here and send to a global dictionary
self.cardDictionary = dictionary;
NSLog(@"%@",cardDictionary);
}
Now when I try to access that variable in another method, still in the RequestModel class, it is null:
-(NSDictionary*)parseDictionaryForCardPage {
//parse dictionary here for data needed on card page
NSLog(@"%@",cardDictionary);
return cardDictionary;
}
This method is called from a viewcontroller class, and cardDictionary is null. How can I make cardDictionary retain its data from the previous method? I tried taking out the self from self.cartDictionary...no luck. Anything else I should know?