// MyClass.h
@interface MyClass : NSObject
{
NSDictionary *dictobj;
}
@end
//MyClass.m
@implementation MyClass
-(void)applicationDiDFinishlaunching:(UIApplication *)application
{
}
-(void)methodA
{
// Here i need to add objects into the dictionary
}
-(void)methodB
{
//here i need to retrive the key and objects of Dictionary into array
}
My question is since both methodA and methodB are using the NSDictionary object [i.e dictobj] In which method should i write this code:
dictobj = [[NSDictionary alloc]init];
I can't do it twice in both methods, hence how to do it golbally?