iphone - NSDictionary variable not being passed to other methods -
i have method takes nsdictionary viewcontroller , assigns global nsdictionary (carddictionary) variable in requestmodel class. carddictionary declared property (nonatomic, retain) , synthesized. works ok (as verified nslog). here is:
-(void)findindexforcardpage:(nsdictionary*)dictionary { //parse here , send global dictionary self.carddictionary = dictionary; nslog(@"%@",carddictionary); }
now when try access variable in method, still in requestmodel class, null:
-(nsdictionary*)parsedictionaryforcardpage { //parse dictionary here data needed on card page nslog(@"%@",carddictionary); return carddictionary; }
this method called viewcontroller class, , carddictionary null. how can make carddictionary retain data previous method? tried taking out self self.cartdictionary...no luck. else should know?
if saying carddictionary global variable, , self.carddictionary - accessing instance variable.
and in
-(nsdictionary*)parsedictionaryforcardpage { //parse dictionary here data needed on card page nslog(@"%@",carddictionary); return carddictionary; }
you accessing global one. delete , use instance variable.
Comments
Post a Comment