i have an NSMutableDictionary declared in a class but i want to print get access to the contents of it in another class for example
@interface MyClass0 : NSObject
{
}
@property (nonatomic, strong) NSMutableDictionary *valuee;
@end
and in implementation i do
@implementation MyClass0
- (void)viewDidLoad{
[super viewDidLoad];
[valuee setObject:@"name" forKey:@"Aryan"];
}
@end
Now i create a new class called MyClass1 where i want to access these
@interface MyClass1 : NSObject
{
}
@property (nonatomic, strong) NSMutableDictionary *dict;
@end
and the implementation
@implementation MyClass1
@synthesize dict;
- (void)viewDidLoad{
[super viewDidLoad];
self.dict = [[NSMutableDictionary alloc] init];
MyClass0 *c = [[MyClass0 alloc] init];
self.dict = c.valuee;
// dict is not nil but the contents inside is nil so it clearly creates a new instance
}
@end